Home  >  Article  >  Web Front-end  >  css attribute selector

css attribute selector

WBOY
WBOYOriginal
2016-07-21 14:53:021058browse

1.[class~="flower"]: Select the class with flower

class="flower ss"

class="ss flower"

2.[class|='top']: Select a class starting with top and need to be connected with '—' or a separate top

class="top-ss"

class="top"

 class="top-ss"//Cannot be selected

3.[class^="top"]: Select top starting with top regardless of whether there are special symbols connected to it, or top alone can also be used

class="top-ss"

class="topss"

4.[class$="top"]: Select the class ending with top, top alone is also OK

class="mytop"

class="my-top"

class="top"

5.[class*='tt']: Select the class with the two letters tt regardless of its position

class="sttd"

class="ttee"

class="eett"

6.[target=_blank]

Target =_blank is selected in the a tag

7.input[type="button"]

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:BFC 小结Next article:【CSS】过渡、动画和变换