如何让我的dt和dd列表分成两条独立的行,就像它们应该在Firefox中一样。 IE 8出于某种原因将它们放在同一条线上!为什么呢?
为什么不明确:离开工作?
我的doctype是DOCTYPE html 5
好点 - http://jsfiddle.net/4mAAL/
<dl>
<dt><h3 class="nocufon">Climate change levy (CCL)</h3></dt>
<dd>A tax on energy usage introduced in 2001. It aims to provide an incentive to increase energy efficiency and reduce carbon emissions.</dd>
<dt><h3 class="nocufon">CO2</h3></dt>
<dd>Carbon dioxide is one of the so-called 'greenhouse gases'. Burning fossil fuels releases CO2 into the atmosphere, which is believed to be a major cause of climate change.</dd>
<dt><h3 class="nocufon">Audit</h3></dt>
<dd>An independent examination of how something works, for example, how a company produces CO2</dd>
<dt><h3 class="nocufon">Benchmark</h3></dt>
<dd>To compare your company's carbon emissions against similar other organisations to see how much work needs to be done.</dd>
<dt><h3 class="nocufon">Carbon footprint</h3></dt>
<dd>The total volume of carbon emissions produced by a company, organisation or individual.</dd>
<dt><h3 class="nocufon">Carbon neutral</h3></dt>
<dd>For a company, to have zero net carbon emissions (e.g. by using only renewable energy or through offsetting its emissions through the purchase of approved carbon credits).</dd>
<dt><h3 class="nocufon">Carbon Trust</h3></dt>
<dd>Body created by the government to help businesses and organisations reduce their carbon emissions. It also funds the development of low carbon technology.</dd>
<dt><h3 class="nocufon">Carbon Trust Standard</h3></dt>
<dd>Initiative that provides a robust and clear definition of good practice that can be used to judge a company's commitment to carbon reduction.</dd>
<dt><h3 class="nocufon">Cause related marketing</h3></dt>
<dd>To partner with a good cause as part of a marketing strategy, for example, donating a percentage of profits from products sold to a selected charity.</dd>
<dt><h3 class="nocufon">Climate change</h3></dt>
<dd>A commonly used phrase to describe the theory that pollution caused by humans, including carbon emissions, is damaging the earth's ecology.</dd>
<dt><h3 class="nocufon">Climate change levy (CCL)</h3></dt>
<dd>A tax on energy usage introduced in 2001. It aims to provide an incentive to increase energy efficiency and reduce carbon emissions.</dd>
<dt><h3 class="nocufon">CSR</h3></dt>
<dd>Corporate Social Responsibility is a form of self-regulation used by companies to take responsibility for their impact on people and the environment. This often feeds into marketing strategy.</dd>
</dl>
答案 0 :(得分:1)
您是否尝试将clear:left;
添加到控制dd
?
编辑:
#glossary dd {
clear: left;
}
不起作用,因为我的网页上找不到#glossary
。
dd { clear: left }
应该有用。
或者您可以提供包含def列表dl
的{{1}},这将使您的css标记起作用。
答案 1 :(得分:0)
在CSS中,覆盖UA样式表:
dd, dt { display:block }
但是,我怀疑IE UA表不会显示它们:内联。你验证了你的HTML和CSS吗?
答案 2 :(得分:0)
你的h3标题不在dt元素中 h3元素在dt元素中是不允许的,因此你的HTML无效。基本上所有的赌注都是关于期望浏览器之间的一致行为,你应该首先让你的HTML有效。