【发布时间】:2014-05-17 10:07:37
【问题描述】:
使用下面的代码(以及我尝试过的其他几种变体),当我缩小浏览器窗口并且我的文本变成多行时,下一行总是落在文本左侧的图像下方。如何保持生成的多行文本在图像旁边垂直对齐?我注意到图像旁边有很多单行文本的解决方案,但没有看到多行文本的解决方案。
<div id="printnotice" style="float:left;margin-top:5px;margin-bottom:10px;width:95%;text-align:center;">
<div style="float:left;margin:auto;display:block;">
<img style="align:left;vertical-align:middle;" alt="STOP" src="/Portal Content/Home/Stop">
<span style="margin-left:20px;font-family:Calibri;font-size:1.5em;">Required: Print Registration Information and Support Options and give to customer</span>
</div>
</div>
【问题讨论】:
-
请使用样式表而不是内联样式:jsfiddle.net/D6P48
-
没有任何
align属性。
标签: css html text vertical-alignment