如何制作在已定义的 中工作标签?
我有一个标签似乎被浏览器忽略,因为它已经是一个具有如下样式定义的标签:
.content .chapter_text {
margin-bottom: 0em;
padding: 0.5em;
line-height: 1.4em;
}
.content .chapter_text li{
list-style-image: url("http://www.comehike.com/img/ui/circle.png");
margin-left:20px;
}
.content .chapter_text li a{
color: #7e9940;
text-decoration: none;
}
.content .chapter_text a:hover{
color: #3f6b30;
}
我正在处理的页面在这里: http://www.comehike.com - 查看中心列和右列的中间部分。
标题链接位于内部,但不呈现。我应该如何编辑样式以使其呈现?
谢谢, 亚历克斯
I have an tag that seems to be ignored by the browser because it is already also an tag that has styling defined like this:
.content .chapter_text {
margin-bottom: 0em;
padding: 0.5em;
line-height: 1.4em;
}
.content .chapter_text li{
list-style-image: url("http://www.comehike.com/img/ui/circle.png");
margin-left:20px;
}
.content .chapter_text li a{
color: #7e9940;
text-decoration: none;
}
.content .chapter_text a:hover{
color: #3f6b30;
}
The page I am working on is here: http://www.comehike.com - see the middle section in center and right columns.
The links of titles are inside but it doesn't render. How should I edit the styling to make it render?
Thanks,
Alex
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在
内无效,甚至在
内无效 --
;
是块级标记,是内联标记。因此,您将在不同的浏览器中获得不一致的行为。例如,Chrome 在内部将此 HTML 重写为:
您将需要重新构造 HTML,以便不会发生这种嵌套,或者使用内联元素代替
。
<h3>
isn't valid within<a>
, or even within<p>
--<h3>
is a block-level tag and<a>
is inline. As such, you're going to get inconsistent behavior in different browsers. For instance, Chrome internally rewrites this HTML to:You're going to need to restructure your HTML so that this nesting doesn't happen, or use an inline element in the place of
<h3>
.看起来你必须做这样的事情:(
注意 { 之前的 h3 )
这有效吗?
Looks like you are going to have to do something like this:
(Notice the h3 before the { )
Does this work?
块级元素和内联元素的渲染方式不同。通常块级元素从新行开始,而内联元素则不是。因此,如果您放置 div、p、h1..h6 等块级元素,它将是无效的 html 标记。
请检查w3 规范。您还可以查看这个问题
Block level and inline elements render differently. Normally block level elements begin on new line wheres inline element is not. so, if you put block level elements such as div,p,h1..h6 it will be invalid html markup.
Please check w3 specification. You may also have a look in this question