Css Internet Explorer:使文本填充空间
我知道这很具体,但我似乎找不到答案。我知道IE在解释布局中框的大小时有问题,但我不确定这是否与我的问题有关 基本上,这个页面上的文本不会填满可用空间,即使它的父元素允许文本全部在一行上 此CSS分别控制父元素和链接Css Internet Explorer:使文本填充空间,css,internet-explorer,Css,Internet Explorer,我知道这很具体,但我似乎找不到答案。我知道IE在解释布局中框的大小时有问题,但我不确定这是否与我的问题有关 基本上,这个页面上的文本不会填满可用空间,即使它的父元素允许文本全部在一行上 此CSS分别控制父元素和链接 #threeCol { clear: both; float: left; margin-top: 18px; width: 100%; margin-bottom: 10px; } #threeCol .col { ba
#threeCol {
clear: both;
float: left;
margin-top: 18px;
width: 100%;
margin-bottom: 10px; }
#threeCol .col {
background: #edf1f7;
color: white;
float: left;
margin-right: 1px;
width: 316px;
height: 320px;
}
#threeCol .col.last {
margin-right: 0px;
}
#threeCol .col .hl {
background: #0F2B6B;
color: white;
display: block;
font-size: 1.5em;
padding: 20px;
text-align: justify;
}
#threeCol .col .cl {
background: #e6ebf2;
color: #0F2B6B;
font-size: 1.1em;
line-height: 1.2em;
padding: 20px;
}
#threeCol .col .cl a
{
background: rgba(15, 43, 107, 0.1);
clear: both;
color: #0F2B6B;
float: left;
font-size: 0.85em;
margin-bottom: 3px;
padding: 4px 0px 4px 15px;
}
#threeCol .col .cl a:hover {
text-decoration: none;
background: rgba(15, 43, 107, 0.8);
color: white;
}
HTML
学校及;教师
教育下载
您发布的代码没有显示您在问题中提到的问题
实际上,这是意料之中的,因为默认情况下-文本换行
但是,如果您想使用暴力,则可以将空白:pre-wrap
添加到
#三列.col.cla
类。还有,什么渲染模式?(是标准模式还是兼容模式还是怪癖模式?)版本8-10有这个问题,我相信它的正常渲染模式,我不知道如何切换,因为我不习惯IE和我使用browserStack。HTML源代码输入IE的模式:使用IE开发工具查看IE使用的模式。您可以通过按F12键(是的,甚至在browserStack中)或从“工具”菜单中选择它来访问开发工具。在“开发工具”窗口中,您将能够在右上角看到模式信息。另外,当你在那里的时候,开发工具将允许你更详细地检查DOM,这样你就可以通过检查里面的一些东西来看看哪里出了问题。是的,我用开发工具来检查它,但是没有太多的意义,这些元素看起来就像是在我插入换行符或其他什么的时候。他们只是不使用可用的空间。IE10中的兼容模式也会产生同样的错误。你能不能只使用空白:nowrap;?
<div class="col last">
<div class="hl">Schools & teachers</div>
<div class="cl">
Educational downloads
<br>
<a href="materials/schools-resource-pack.pdf">» Schools Resource Pack</a>
<br>
<a href="http://www.liberty-human-rights.org.uk/materials/human-rights-act-poster-february-2010.pdf">» Human Rights Act Poster</a>
<br>
<a href="http://www.liberty-human-rights.org.uk/materials/new-guide-to-campaigning.pdf">» Liberty Guide to Campaigning</a>
<br>
</div>
</div>