本文介绍了如何控制CSS中列表风格类型光盘的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的HTML第一:

<ul class="moreLinks" >
    <div>More from Travelandleisure.com</div>

        <li><a rel="nofollow" href="">xyz1</a></li>
    <li><a rel="nofollow" href="">xyz1</a></li>
    <li><a rel="nofollow" href="">xyz1</a></li>
</ul>

我知道我可以在li上使用字体大小,然后将css应用于li中的a。但我不知道为什么这不工作的网站我工作。我不能直接控制html。

I know that I can apply font-size on li very small so that disc look correct to me and then apply css to "a" inside li. But I do not know why this is not working on the site I am working. I cannot control the html directly.

我看到当我这样做:

.farParentDiv ul li {
    list-style: disc inside none;
}

TO:

.farParentDiv ul li {
    list-style-type: disc;
    font-size:10px;
}

现在将字体大小应用于a后,它在Firebug 。但从我的css文件。我试了很多,但累了。我可以覆盖上面这在css文件,但不能改变它直接,因为我在firebug。请写下可能出现的问题?

and now after applying font-size to "a", it works in Firebug. but from my css file. I tried a lot but tired. I can overwrite the above this in css file but cannot change it directly as I did in firebug. Please write what can be the problem?

我用来在链接内部放入点(。),然后应用css来控制光盘大小,说,我不能控制HTML。

I used to put dots (.) just before link inside and then apply css on that to control the disc size, but as I said, I cannot control the HTML.

推荐答案

我一直使用背景图片而不是信任所有浏览器以完全相同的方式解释项目符号。这也会让你严格控制子弹的大小。

I have always had good luck with using background images instead of trusting all browsers to interpret the bullet in exactly the same way. This would also give you tight control over the size of the bullet.

.moreLinks li {
    background: url("bullet.gif") no-repeat left 5px;
    padding-left: 1em;
}

此外,您可能需要将 DIV 以外的 UL 。它是无效的标记,因为你现在有它。如果必须在列表中,可以使用列表头 LH

Also, you may want to move your DIV outside of the UL. It's invalid markup as you have it now. You can use a list header LH if you must have it inside the list.

这篇关于如何控制CSS中列表风格类型光盘的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 23:05