css样式使字母加粗后,某些链接不会显示为粗体
我有这个CSS:
.content .chapter_text li a
{
color: #7e9940;
text-decoration: none;
font-weight: bold;
}
在同一页面上,它有它工作的地方,也有它不起作用的地方。
看一下这里:http://www.comehike.com - 在页面底部,链接出现以粗体文字显示。在页面中间,链接以非粗体文本显示。
但据我所知,它们的风格是一样的。知道为什么主页中间的链接不显示为粗体吗?
谢谢!!
I have this css:
.content .chapter_text li a
{
color: #7e9940;
text-decoration: none;
font-weight: bold;
}
And on the same page, it has places where it works, and also places where it doesn't work.
Take a look here: http://www.comehike.com - on the bottom of the page, the links appear in bold text. In the middle of the page, the links appear in non-bold text.
But they are styled the same - as far as I can tell. Any idea why the links in the middle of the home page do not appear bold?
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是因为中心的那些链接不在
li
中。您可以将 CSS 修改为以下内容以获得想要的结果:That's because those link in the center are not in a
li
. You could modify your CSS to the following to get the wanted result:它们不包含在
li
元素中,因此样式不适用。你必须把它们移到一个里或者使它像;They are not contained in a
li
element so the style does not apply. You have to move them into a li or make it like;页面中间的链接不是 li 元素的子元素,而 li 元素是选择器的目标元素。
The links in the middle of the page are not children of an li element, which is what your selector targets.