Add bullet styling to dd element

筅森魡賤 提交于 2019-12-18 03:54:59

问题


I am using dl, dt and dd tags in one of my projects. I want to show a bullet before dd. How can I make my dds into a bullet list using CSS?


回答1:


Easiest way is to change the properties on your <dd>

dd {
    display: list-item;
    list-style-type: disc;
    }

Works in every browser.

See this article: http://www.quirksmode.org/css/display.html




回答2:


Use a background-image.

Or try:

dd
{
    display: list-item;
    list-style-type: disc;
}

No idea if it will work though.




回答3:


tested it in firefox and just adding the style display:list-item should do the trick




回答4:


You can either use the style attribute in the "dd" tag, or move that to a "style" section as a class or id. Since the dl is a list type you do not need the "display: list-item;" I think, might also be wrong. Anyways This might be used. Instead of the disc, you might use other types (look at http://www.w3schools.com/css/pr_list-style-type.asp)...

<html>
  <body>
    <dl>
      <dt>Term</dt>
      <dd style="display: list-item;">Term description</dd>
    </dl>
  </body>
</html>

Hope this helps.



来源:https://stackoverflow.com/questions/1721116/add-bullet-styling-to-dd-element

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!