--- title: 'Проверьте ваши навыки: Селекторы' slug: Learn/CSS/Building_blocks/Селекторы/Селекторы_Задачи tags: - CSS - Начинающий translation_of: Learn/CSS/Building_blocks/Selectors/Selectors_Tasks ---
Цель этой задачи — помочь вам проверить ваше понимание селекторов в CSS.
Примечание: Вы можете проверять решения в интерактивном редакторе, расположенном ниже, но, возможно, вам будут полезны онлайн-инструменты, такие как CodePen, jsFiddle или Glitch, которые можно использовать для работы над заданием, предварительно загрузив в них код.
Если вы зашли в тупик, обратитесь к нам за помощью — смотрите раздел Оценка или дальнейшая помощь внизу этой страницы.
Without changing the HTML, use CSS to do the following things:
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.
Without changing the HTML, make the following changes to the look of the content in this example:
special
a yellow background.alert
a 1px grey border.alert
also has a class of stop
, make the background red.alert
also has a class of go
, make the background green.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.
In this example, try making the following changes without adding to the HTML.
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.
In this task try the following:
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.
In this final task add CSS using attribute selectors to do the following:
<a>
element with a title
attribute and make the border pink (border-color: pink
).<a>
element with an href
attribute that contains the word contact
somewhere in its value and make the border orange (border-color: orange
).<a>
element with an href
value starting with https
and give it a green border (border-color: green
).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.
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: