html - 定义列表格式未按预期工作

标签 html css wordpress formatting wordpress-theming

通过尝试复制我喜欢的产品页面,我了解了更多关于定义列表的信息。

正确添加标签并注意到它们具有一些自然的样式。

我在谷歌上找到了这段代码并将其添加到我的主题的 custom.css 文件中,它没有改变任何东西。

dt {
    font-weight: bold;
    text-decoration: underline;
  }
  dd {
    margin: 0;
    padding: 0 0 0.5em 0;
  }

谁能告诉我为什么?

谢谢!

最佳答案

一些代码会很好,将您的代码复制到 jsfiddle并设置示例。可能它被默认样式覆盖了,尝试添加 !important 到 css 属性。

dt {
    font-weight: bold important;
    text-decoration: underline important;
  }
  dd {
    margin: 0 !important;
    padding: 0 0 0.5em 0 important;
  }

这将覆盖任何 css 属性,但您应该仅将其用于测试。

关于html - 定义列表格式未按预期工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27993564/

相关文章:

html - 文本不在一行上调整

php - Wordpress:如何获取特定类别的链接

wordpress - WP - check_password_reset_key 函数总是返回过期 key

javascript - 如何在输入字段中填充选定值

jQuery:加载和使用大型 XML 文件的最快方式

php - 仅隐藏 Wordpress 帖子中的第一张图片

css - 如何在另一个div中顶部对齐一个div

css - @font-face 未在 Wordpress 中加载

html - 背景图像未在 chrome 中显示

html - 如何找出打开了多少层?