我有一个像下面的页面;图像显示在块<a> - CSS
<style type="text/css">
#div1 {
height: 100px;
background-color: #CCCCCC;
}
#div2 {
display: inline;
height: 48px;
margin: 0;
padding: 0;
position: relative;
white-space: nowrap;
}
#div2 a {
display: block;
background-color: #FF9900;
height: 51px;
width: 150px;
padding-right: 50px;
text-decoration: none;
word-wrap: break-word;
white-space: normal;
}
#div2 img {
border:0;
float: right;
}
</style>
<div id="div1">
<div id="div2">
<a href="">text1 text2 text3 text4 text5 text6 text7 text8<img src="image.jpg"></a>
</div>
</div>
我得到的是这样的;
,我想这一点;
Here是小提琴。
亲爱的看到我的回答,让我知道如果我滞后一些地方。 – w3uiguru 2012-04-05 17:25:53
不,你不落后,你只是通过设置图像的位置选择另一种方法。但是我个人不喜欢在没有必要的时候使用职位。只是个人喜好。 – 2012-04-05 17:29:04