想要得到CSS文本换行工作在IE7 [英] Want to get CSS Text Wrap working in IE7
本文介绍了想要得到CSS文本换行工作在IE7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下代码在FF3中呈现得很好,但在IE7中不工作。有没有人知道如何解决它?
The following code renders great in FF3 but doesn't work in IE7. Does anyone have an idea how to fix it?
<div style="padding-top:3px;padding-bottom:5px;width:650px;background:blue">
<div style="height:50px;float:left;display:inline;width:500px;background:gray">http://www.brainsolis.com/2008/10/twitter-tools-for-comunity-and-love-for-...</div>
<div style="width:100%;text-align:right;float-right;background:yellow">saaal is saaa twittertool ds ds dsdfsdsdfsdfsdfsdfsdfsd sdf dsf sdf sdf sdf sd ssssssssssssssssssssssssssssssssssssssssssssssssssss</div>
</div>
推荐答案
您不需要元素,以及 display:inline 。此外,您不需要为DIV元素设置 width:100%。
You do not need to float an element, and display:inline at the same time. Additionally, you do not need to set width:100% for DIV elements. They will naturally take up all available horizontal space.
以下的CSS应该能够达到你所想要的效果。
The following CSS should achieve what you are attempting.
div.container {
}
div.floated {
width:50px;
float:left;
}
div.textbody {
/* styles */
}
br.clear {
clear:both;
height:0;
line-height:0;
}
<div class="container">
<div class="floated">
<p>This is floated</p>
</div>
<div class="textbody">
<p>...text body...</p>
</div>
<br class="clear" />
</div>
有关CSS的详细信息,请检查 w3schools ,或观看 Sampson Videos的CSS视频。
For more information on CSS, check w3schools, or watch the CSS Videos at SampsonVideos.
这篇关于想要得到CSS文本换行工作在IE7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文