Add bullet styling to dd element

2019-01-24 01:05发布

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?

标签: css xhtml
4条回答
\"骚年 ilove
2楼-- · 2019-01-24 01:43

Use a background-image.

Or try:

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

No idea if it will work though.

查看更多
叛逆
3楼-- · 2019-01-24 01:58

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.

查看更多
成全新的幸福
4楼-- · 2019-01-24 02:01

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

查看更多
爷、活的狠高调
5楼-- · 2019-01-24 02:07

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

查看更多
登录 后发表回答