HTML basic selectors

不言
Release: 2018-04-28 16:46:28
Original
2378 people have browsed it

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

The role of selectors

You can operate various styles and attributes of html more conveniently and quickly in the style sheet

Classification

1. Tag type selector: Set styles for tags

a{
  text-decoration: none;
}
Copy after login

2. Contains selector

span[class=demo]{
    color:red;
}
Copy after login

3. Contains selector inside

p a{
    text-decoration: underline;
    font-size: 30px;
    color:#ff00ff;
}
Copy after login

4. Sub-object selector

body>p{
    font-size:34px;
}
Copy after login

5. ID selector

#content{
    border-style: solid;
}
Copy after login

6. Class selector

.note{
    font-size: 34px;
}
span.note1{
    font-size: 54px;
}
Copy after login

7. Group selector

td,p,a{
				
}
Copy after login

The above is the detailed content of HTML basic selectors. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!