Home >Web Front-end >HTML Tutorial >HTML basic selectors
This article introduces the basics of HTML selectors, which has certain reference value. Now I share it with you. Friends in need can refer to it
You can operate various styles and attributes of html more conveniently and quickly in the style sheet
1. Tag type selector: Set styles for tags
a{ text-decoration: none; }
2. Contains selector
span[class=demo]{ color:red; }
3. Contains selector inside
p a{ text-decoration: underline; font-size: 30px; color:#ff00ff; }
4. Sub-object selector
body>p{ font-size:34px; }
5. ID selector
#content{ border-style: solid; }
6. Class selector
.note{ font-size: 34px; } span.note1{ font-size: 54px; }
7. Group selector
td,p,a{ }
The above is the detailed content of HTML basic selectors. For more information, please follow other related articles on the PHP Chinese website!