Skip to content

Instantly share code, notes, and snippets.

@tyv
Created May 21, 2012 14:23
Show Gist options
  • Save tyv/2762567 to your computer and use it in GitHub Desktop.
Save tyv/2762567 to your computer and use it in GitHub Desktop.
все элементы с атрибутом id
body
{
font-size: 24px
}
/* все элементы с атрибутом id */
div[id]
{
color: red;
}
/* все элементы с атрибутом class с определнным значением */
div[class="myclass mysuperclass"]
{
text-decoration: underline;
}
/* все элементы с атрибутом id и определенным класс */
/* не затрагивает двойные — сравнение по строке */
div[id][class="myclass"]
{
border-top: 2px dashed #000;
}
/* а так выбирает по слову */
div[id][class~="myclass"]
{
background: yellow;
}
/*
E[foo^="bar"] — начало
E[foo$="bar"] — конец
*/
/* содержит */
div[title*="ест"]
{
font-style: italic;
}
/*
E[lang|="en"] > lang="en-au"
E[src|="figure"] > img src="figure-1.png", img src="figure-2.png"
*/
<div id="myid">текст</div>
<div class="myclass" title="тут есть текст">текст</div>
<div id="myid2" class="myclass">текст</div>
<div id="myid3" class="myclass mysuperclass">текст</div>
<div id="myid4 mysupperid" class="myclass mysuperclass">текст</div>
{"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment