我的Joomla CMS中的一个模块会生成以下代码:
<li id="myid" clas="">
<span>
<strong>1.</strong>
</span>
<dl>
<dt>
<span>Some text</span>
</dt>
</dl>
</li>
这不能在html中编辑,因为它是通过多个插件创建的。有没有办法让“一些文本”出现在“1”的右边。通过CSS。我试过这样的方法:
li {
display: inline;
}
这不管用。你有什么意见建议?非常感谢!
发布于 2012-02-02 23:27:59
您需要将dl
和dt
设置为显示为inline
,因为它们的缺省值为block
#myid dl, #myid dt {
display: inline;
}
发布于 2012-02-03 04:01:17
为什么不使用有序列表而不是无序列表呢?它可以简化..
但是如果你想继续你的代码,你必须从列表编号中删除"“标签,因为它会被弃用。解决方案是在您的号码标签中添加class='strong‘,并添加更多css,下面是'strong’类的代码:
#myid .strong{
font-weight:bold;
}
你的html代码:
<li id="myid" clas="">
<span class="strong">1.</span><dl>
<dt>
<span>Some text</span>
</dt>
</dl>
</li>
https://stackoverflow.com/questions/9121569
复制