HTML Wildcard Selector __html

Source: Internet
Author: User
Tags tag name

Wildcard selectors typically have three kinds: class,id and HTML

Class: With the # ID: used. HTML: Tag name that is directly HTML

The precedence of wildcard characters is: id>class>html


If there is an ID and class at the same time in a label, the property will execute if there is no conflict, but if the property has a conflict, such as setting the class in the ID setting the text color to green, and setting the color to yellow in class, then the text will appear green by priority.

Exception, you can set the parent-child Selector

<body>
    Hello, Beijing ...
    <span class= "Style1" > News one </span>
    <span class= "Style1" > News II </span>
    <span class= "Style1" > news three </span>
    <span id= "Style2" > news four <span > This is a very important news. <span> second nesting span</span></span></span>
  </body>
The CSS file is:
#style2 {
	color:green;
	font-size:30px;
	background-color:silver;
}

#style2 span{
	Color:yellow;
	Font-weight:bold;
}

#style2 span span{
	color:black;
	Background-color:silver;
}
Exceptions, if there are two Cass, as follows:

<span class= "Style1 style3" > ID and class</span>
In this case, the order of execution is not based on the order of class, but according to the position of Style1 and Style3 in CSS, who is in the back, the final effect is who, similar to the effect of coverage.


Add. Wildcard characters

*{
	margin:0px;
	padding:0px;
}
Margin: upper right and lower left--clockwise

If there are only 3: margin:0px 10px 20px then it is (up and down) right left


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.