--- title: 'Test your skills: Selectors' slug: Learn/CSS/Building_blocks/Selectors/Selectors_Tasks translation_of: Learn/CSS/Building_blocks/Selectors/Selectors_Tasks ---
{{LearnSidebar}}

这个任务的目的是帮助你理解CSS里的选择器。

Note:你可以 在下面那些交换编辑器中尝试解决问题,然而  把代码下载然后使用一个在线工具比如 CodePen, jsFiddle, or Glitch 去解决这些问题可能对你更有作用。

如果你卡住了,可以向我们寻求帮助 — 请参阅本页底部的Assessment or further help 部分。

选择器一

在没有改变HTML的情况下,使用CSS去完成下面的要求::

Text with the CSS applied for the solution to task 1.

Try updating the live code below to recreate the finished example:

{{EmbedGHLiveSample("css-examples/learn/tasks/selectors/type.html", '100%', 700)}}

For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.

选择器二

在没有改变HTML的情况下,对本例中内容的外观进行以下更改:

Text with the CSS applied for the solution to task 2.

Try updating the live code below to recreate the finished example:

{{EmbedGHLiveSample("css-examples/learn/tasks/selectors/class-id.html", '100%', 800)}}

For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.

选择器三

在本例中,尝试在不添加HTML的情况下进行以下更改。

Text with the CSS applied for the solution to task 3.

Try updating the live code below to recreate the finished example:

{{EmbedGHLiveSample("css-examples/learn/tasks/selectors/pseudo.html", '100%', 800)}}

For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.

选择器四

在这个任务中尝试下面这个任务:

Text with the CSS applied for the solution to task 4.

Try updating the live code below to recreate the finished example:

{{EmbedGHLiveSample("css-examples/learn/tasks/selectors/combinators.html", '100%', 800)}}

For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.

选择器五

在最后一个任务中,使用属性选择器添加CSS以执行以下操作:

Four links with different color borders.

Try updating the live code below to recreate the finished example:

{{EmbedGHLiveSample("css-examples/learn/tasks/selectors/attribute-links.html", '100%', 800)}}

For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.

Assessment or further help

You can practice these examples in the Interactive Editors mentioned above.

If you would like your work assessed, or are stuck and want to ask for help:

  1. Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections.
  2. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: