Skip to content

Instantly share code, notes, and snippets.

View tyv's full-sized avatar

Yuri Tkachenko tyv

  • Ukraine/Kyiv
View GitHub Profile
@tyv
tyv / dabblet.css
Created May 21, 2012 16:22
самый распространенный: все потомки
/* самый распространенный: все потомки */
.parent .child
{
aborder: 1px solid red;
}
/*
все селекторы можно уточнять
именами элементов ol.parent li.child
*/
@tyv
tyv / dabblet.css
Created May 21, 2012 16:54
E:nth-of-type(an+b)
/*
E:nth-of-type(an+b)
тоже самое, но работает только с группой E-элементов
p:nth-child(2)
это параграф && это второй элемент своего родителя
p:nth-of-type(2)
это второй параграф своего родителя
http://css-tricks.com/the-difference-between-nth-child-and-nth-of-type/
@tyv
tyv / dabblet.css
Created May 21, 2012 18:56
E:nth-child(an+b)
/*
E:nth-child(an+b)
разбивает все E-элементы
на a-групп (остаток в последней)
выделает b-элемент в каждой
E:nth-last-child(an+b)
тоже самое но с конца коллекции элементов
могут принимать значения odd (=2n+1)
@tyv
tyv / dabblet.css
Created May 22, 2012 08:10
:first- |:last- child — любой E,
/*
:first- |:last- child — любой E,
являющийся первым или последним ребенком
*/
.parent li:first-child
{
border: 3px solid red;
}
@tyv
tyv / dabblet.css
Created May 22, 2012 10:45
любые стили для :visited
/*
любые стили для :visited
отключены в webkit по
соображениям безопастности
*/
:visited
{
/* разрешается менять только color */
color: red;
}
@tyv
tyv / dabblet.css
Created May 22, 2012 11:39
Untitled
#i-am-a-target:target
{
color: red;
}
@tyv
tyv / dabblet.css
Created May 22, 2012 11:46
Untitled
input + label
{
color: green;
}
input:checked + label
{
color: red;
}
p:first-line,
span:first-line /* не работает у строковых элементов */
{
font-size: 200%;
}
p:first-letter,
span:first-letter /* но почему не работает тут?! upyachka.gif */
{
color: red;
@tyv
tyv / dabblet.css
Created May 22, 2012 12:21
Untitled
.i:before
{
content: 'before ';
color: green;
}
.i:after
{
content: ' after';
color: red;
@tyv
tyv / dabblet.css
Created May 22, 2012 13:09
выберет все элементы "не ссылки"
form input[type="checkbox"]:disabled + label
{
color: #ccc
}
form input[type="checkbox"]:not(:disabled)
{
font-size: 150%;
}