我有这样的标记
<div> <h1 style="text-align:center;" >Heading 1</h1> <img style="float:left;" src="logo.gif"/> <h1 style="text-align:center;" >Heading 2</h1> </div> <div> Content goes here </div>
解决方法@H_301_10@
一种方法是使用徽标的大小为div添加右边距:
<div style="padding-right: 50px;">
<img style="float:left;" src="logo.gif"/>
<h1 style="text-align:center;" >Heading</h1>
</div>
<div>
Content goes here
</div>
另一种方法是从流中删除标题.这只能假设徽标高度大于航向高度.还要注意图像和标题可能会重叠.
<h1 style="position: absolute; width: 100%; text-align:center;">
Heading
</h1>
<img style="float:left;" src="logo.gif"/>
<div style="clear:both;">
Content goes here
</div>
<div style="padding-right: 50px;"> <img style="float:left;" src="logo.gif"/> <h1 style="text-align:center;" >Heading</h1> </div> <div> Content goes here </div>
另一种方法是从流中删除标题.这只能假设徽标高度大于航向高度.还要注意图像和标题可能会重叠.
<h1 style="position: absolute; width: 100%; text-align:center;"> Heading </h1> <img style="float:left;" src="logo.gif"/> <div style="clear:both;"> Content goes here </div>