The selector is the tag that specifies the CSS to function, and the name of the tag is the selector. Select which container (the label itself is the container that encapsulates the data).
@CHARSET "UTF-8"; There are many kinds of selectors in/*css, the first is the most basic element selector (aka Type selector). * The element of the document is the most basic selector. * If you set the HTML style, the selector will usually be an HTML element, such as p, H1, EM, a, or even the HTML itself: */h2{Color:blue; }/* Second selector: class style selector///* Set all "AA" class styles. aa{background-color: #00FF00; }/* * Just set the "AA" style in P */p.aa{Background-color: #00FF00; }. bb{Background-color: #004444; }/* The third selector ID selector *id selector allows you to specify a style in a way that is independent of the document element. * In some ways, the ID selector is similar to a class selector, but there are some important differences. *//*id Selector */#d1 {background-color: #0000FF; }/* Other selectors *//*1. Association selector */P span{/* Select the span*/font-size:20pt in the P label container; }/*2. Combo selector */P span,.c, #d1 {color:red; /*3. Pseudo-Element selectors//*CSS pseudo-elements are used to set special effects to certain selectors. */span:hover {background-color: #FFFF00; font-size:20pt; Cursor:pointer; } a{teXt-decoration:none; }/*l-v-h-a*/a:link{color:red; font-size:12pt; } a:visited{Color:blue; font-size:16pt; } a:hover{Background-color: #00FF00; font-size:20pt; } a:active{color: #FFFF00; } input:focus{Background-color: #00FFFF; }/* Asterisk selector, select all */*{text-decoration:underline; }/* Property selector, all elements with the type attribute */[type]{margin:10px; }/* has the name attribute and the property value is ' math ' */[name= ' Math ']{background-color: #0ff; } a[href= "http://www.w3school.com.cn/"][title= "W3school"] {color:red; }/* Association selector---descendants */h1 em{color:red; }/* child element Selector---son */p > em{color:blue; }/* Adjacent element selector---successor Brother */Li + li {font-weight:bold; }
Related articles:
CSS class selector and ID selector
CSS Selector collation
Related videos:
Class Selector-2016 new curriculum system HTML+CSS video