Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Стольников Константин #101

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion tasks/1.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,21 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
.c1
{
background-color: #ff6698;
}

#id
{
background-color: #98ff66;
}

div,
aside
{
background-color: #6698ff;
}
</style>

<section class="global-result">
Expand Down
10 changes: 9 additions & 1 deletion tasks/10.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
.title::first-letter
{
color: #ff6698;
}

.description:first-line
{
color: #6698ff;
}
</style>

<section class="global-result">
Expand Down
16 changes: 15 additions & 1 deletion tasks/11.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,21 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
input:first-child
{
border: 3px solid #ff6698;
}

input
{
border: 3px solid #98ff66;
}

input:focus
{
border: 3px solid #6698ff;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В двух селекторах с псевдоклассами полностью переопределяется правило, задающее стили для границы в селекторе тега input, хотя разница только в цвете этой границы. Можно в селекторах с псевдоклассами :first-child и :focus переназначать только border-color

}

</style>

<section class="global-result">
Expand Down
21 changes: 20 additions & 1 deletion tasks/12.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,26 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
div
{
background-color: #ff6;
}

div:nth-child(4n-1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Попробуй использовать псевдокласс :empty

{
background-color: #ffb366;
}

div:last-child
{
background-color: #ffb366;
}

div:first-child
{
background-color: #ffb366;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Правило дублируется

}

</style>

<section class="global-result">
Expand Down
5 changes: 4 additions & 1 deletion tasks/13.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
div:nth-child(4n + 1) > div:first-child

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Обрати внимание на псевдокласс only-of-type

{
background-color: #ff6698;
}
</style>

<section class="global-result">
Expand Down
12 changes: 11 additions & 1 deletion tasks/14.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
article
{
margin-left: 15px;
}

ul
{
list-style-type: square !important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Получится ли не прибегать к !important здесь? Подсказка: можно стилизовать псевдоэлементы, например, before

/*вместо плюсиков, хотя можно использовать list-style-image
и дать свою картинку, ну ты понял..*/
}
</style>

<section class="global-result">
Expand Down
11 changes: 10 additions & 1 deletion tasks/15.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
[href*='.zip.']
{
background-color: #fff !important;
}

[href*='.zip']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Достаточно выбрать только те ссылки, которые заканчиваются на .zip

{
/*чем мне их выделять?*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если хочешь добавить стрелочку, то проще всего будет поместить её в контент какого-нибудь псевдоэлемента, например, after.

background-color: #cacaca;
}
</style>

<section class="global-result">
Expand Down
20 changes: 19 additions & 1 deletion tasks/16.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,25 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
div

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь достаточно выбрать первый элемент

{
background-color: #ff6698 !important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

important

}

.c1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно повысить специфичность правила и без !important. Например, можно увеличить вложенность селектора класса

https://developer.mozilla.org/ru/docs/Web/CSS/Specificity

{
background-color: #6698ff !important;
}

#id1
{
background-color: #ffb366 !important;
}

.c7
{
background-color: #ff6 !important;
}
</style>

<section class="global-result">
Expand Down
10 changes: 9 additions & 1 deletion tasks/17.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
input:checked
{
outline: none !important;
}

input:checked ~ input

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В селекторе брата можно выбрать только те инпуты, которые не имеют псевдокласса checked

{
outline: 1px solid #ff6698;
}
</style>

<section class="global-result">
Expand Down
10 changes: 9 additions & 1 deletion tasks/18.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
.global-scope > div
{
opacity: .3;
}

.global-scope > div:hover
{
opacity: 1 !important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Попробуй тоже обойтись здесь без !important. Подсказка: можно отлавливать :hover на теге article и на теге div

}
</style>

<section class="global-result">
Expand Down
30 changes: 29 additions & 1 deletion tasks/19.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,35 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
.global-scope > div

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется, здесь во всех селекторах можно не указывать родительский класс

Suggested change
.global-scope > div
div

{
background-color: #ffb366;
}

.global-scope > div > div

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно ли упростить селектор, используя псевдокласс empty?

{
background-color: #fff;
}

.global-scope > div:first-child > div:last-child
{
background-color: #98ff66;
}

.global-scope > div:last-child > div:first-child
{
background-color: #ff6;
}

.global-scope > div:nth-child(3) > div:nth-child(2n-1)
{
background-color: #6698ff;
}

.global-scope > div:nth-child(2) > div:nth-child(2n)
{
background-color: #ff6698;
}
</style>

<section class="global-result">
Expand Down
17 changes: 16 additions & 1 deletion tasks/2.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,22 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
div.c1.c2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь точно нужен селектор тега?

{
background-color: #6698ff;
border: 2px solid #000;
}

.c1
{
background-color: #ff6698;
border: 2px solid #000;
}

.c2
{
background-color: #ffb366;
}
</style>

<section class="global-result">
Expand Down
11 changes: 10 additions & 1 deletion tasks/3.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
div

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Правило из этого селектора должно применяться только к непосредственным потомкам .global-scope. Тогда в следующем селекторе можно будет не переназначать стили границы

{
border: 2px solid #000;
}

article.global-scope.global-scope_3 > div > div

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно ли здесь обойтись без всей первой части селектора?

Suggested change
article.global-scope.global-scope_3 > div > div
div div

{
background-color: #6698ff;
border: none;
}
</style>

<section class="global-result">
Expand Down
15 changes: 14 additions & 1 deletion tasks/4.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
article:not(:first-child) + article
{
border-top: 1px solid #000;
}

article > article
{
background-color: #ff6;
}

article:nth-child(2n) + article
{
background-color: #fff;
}
</style>

<section class="global-result">
Expand Down
6 changes: 5 additions & 1 deletion tasks/5.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
input#checkbox:checked ~ div

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем столько селекторов? Не достаточно ли указать только идентификатор или только тег?

{
background-color: black;
color: #fff;
}
</style>

<section class="global-result">
Expand Down
10 changes: 9 additions & 1 deletion tasks/6.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
.global-scope > a:first-child
{
color: #6698ff;
}

.global-scope > a:not(:first-child)
{
color: #ff6698;
}
</style>

<section class="global-result">
Expand Down
15 changes: 14 additions & 1 deletion tasks/7.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
article > div
{
opacity: .3;
}

article > div:first-child
{
opacity: 1;
}

article > div:last-child
{
opacity: 1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь можно просты выбрать все картинки, у которых нет атрибута alt

}
</style>

<section class="global-result">
Expand Down
10 changes: 9 additions & 1 deletion tasks/8.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
[href*='//']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Выбери все абсолютные урлы, в которых не содержится my-site.ru

{
color: #ff6698;
}

[href*='my-site.ru']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для my-site давай не будем переназначать стили

{
color: blue;
}
</style>

<section class="global-result">
Expand Down
20 changes: 19 additions & 1 deletion tasks/9.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,25 @@ <h1 class="global-heading">&nbsp;</h1>

<main class="global-results">
<style>
/* your styles here */
[href]:visited
{
color: #ffb366 !important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Давай здесь везде тоже без !important)
Повысить специфичность можно, указав в селекторе помимо атрибута ещё и класс

}

[href]:focus
{
color: #98ff66 !important;
}

[href]:hover
{
color: #ff6698 !important;
}

.link:hover
{
color: #cacaca;
}
</style>

<section class="global-result">
Expand Down