开发者

How To Add List-style-type: "disc" to <p> tag

This seems like it ought to be ridiculously easy, but I'm having trouble figuring it out.

I want to replicate the <li> function so the disc image appears to the left, but applied to a

tag

I have this, but it does not show the disc image.

.list {
     margin-top: 15px;
     margin-bottom: 15px;
     list-style:disc outside none;
     display:inline; 
     }

&开发者_JAVA技巧lt;p class="list"><em>And Much, Much More!</em></p>

I want to avoid using any graphics to simulate the bullet if at all possible.

Thanks for the help


Answer: display: list-item;

Display must be set to list-item - not inline, and not list!

.list {
     list-style:disc outside none;
     display:list-item; 
     }

<p class="list"><em>And Much, Much More!</em></p>


Well, a p is not a list. Why not use <ul><li>?

[edit] Let me elaborate. The problem is that you set this style on a list, while the disc is shown in the list items. A p has no items in that sense, so there's nothing to apply the disc to.


Only add following style

display:list-item; 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜