Skip to content

有一些我看到的是错误的答案,在这里提出更正 #19

Description

@MirrorYan

CSS 部分问题与解答中

6. 在HTML文本中,伪类:root总是指向html元素?

这题的答案是正确的,这道题的前提是 “在HTML文本中”,HTML文本中的 root 总是指向 html 元素的。
在W3C中有明确的说明 : 请戳这里查看 CSS3 :root 选择器

14. 如下代码中文本“Sausage”的颜色是?

<ul class="shopping-list" id="awesome">
    <li><span>Milk</span></li>
    <li class="favorite" id="must-buy"><span class="highlight">Sausage</span></li>
</ul>
#awesome .favorite:not(#awesome) .highlight {
    color: red;
}
#awesome .highlight:nth-of-type(1):nth-last-of-type(1) {
    color: blue;
}

这里考察的是对CSS选择器优先级的掌握,答案应该是 red

18. mypic.jpg 会被浏览器加载吗?

<div id="test1">
    <span id="test2"></span>
</div>
#test1 {
    display: none;
}
#test2 {
    background-image: url('mypic.jpg');
    visibility: hidden;
}

答案是 会被加载。这里考察的是CSS样式对背景图加载的影响,visibility: hidden 只是不显示,节点在文本流中仍然占有一席之位,背景图仍然会被加载。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions