css note 2

Original link: https://www.mk2048.com/blog/blog.php?id=h0j1hi1hb12j&title=css%E7%AC%94%E8%AE%B0+2

Define a class selector
.center {text-align: center}

h1 class center there. This means that the rules selectors ".center".
<h1 of class = "Center">
This Will BE Center-heading the aligned
</ h1 of>

The first character class name can not use digital!

派生选择器
td.fancy {
color: #f60;
background: #666;
}
<td class="fancy">

Class fancy can be assigned to any table element any number of times.
Those with fancy cell will be marked in orange with a gray background. Those cells has not been assigned a class called fancy not be affected by this rule.
This effect is restricted to a fancy table cell is labeled (i.e., used to select the fancy element td class).

Attribute selectors

[attribute = value]
for selecting elements with the specified attributes and values.
[attribute ~ = value]
is used to select the attribute value contained in the element specified words.


More professional front-end knowledge, make the [2048] ape www.mk2048.com

Guess you like

Origin blog.csdn.net/weixin_39037804/article/details/102749629
Recommended