我知道这是非常具体但我似乎无法找到答案。我知道IE在解释布局中框的大小时遇到了问题,但我不确定这是否与我的问题有关。
基本上,此页面上的文字不会填充可用空间,即使其父元素允许文本全部在一行上。
这个CSS分别控制父元素和链接
#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
<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>
答案 0 :(得分:1)
您发布的代码未显示您在问题中提到的问题
<强> FIDDLE 强>
实际上,这是预期的,因为默认情况下 - 文本换行。
但是,如果您想使用暴力,则可以将white-space: pre-wrap
添加到
#threeCol .col .cl a
上课。