CSS basic knowledge

1, derived selector div span{color:red}

2, id selector#diva{color:red}

3, id selector and Derived selector combined with #diva p{color:red}

4, class selector.divclass{color}, the derived selector under the same class selector.divclass p{}

< p>5. Attribute selector

[ title]{color:red}

Specify named attribute selector [title=”t”]{color:red}

5, padding and margin, for example, black is a p tag (the background is set to black, the text is set to yellow), after padding is set, it is the distance between the text and the background,

margin is the p tag The distance to the superior.

share picture

6. background background

background-color background color, background-image background image, background-position: right top/100px 150px (from left to top), whether background_repeat image is duplicated,

background-attachment image Whether the position is fixed (whether the picture continues to be visible when moving down)

7. Text style

#p3{text-transform:lowercase;}
p{width:300px}

< div> p{text-shadow:3px5px1px#ff0000;}Background shadow, span> The four parameters are the distance from the original coordinate, the distance above, the clarity of the background text, and the color of the background text

#p3{text-transform : lowercase;} span>
p{width:300px }
p{text-shadow:3px< span style="color: #000000;">5px1px< span style="color: #000000;">#ff0000;}Background shadow, The four parameters are, the distance from the original coordinate , Above distance, background text clarity, background text color

#p3{ text-transform:lowercase;}

p< span style="color: #000000;">{width:300px}

p{text-shadow:3px5px1px#ff0000;}Background shadows, The four parameters are the distance from the original coordinate, the distance above, the clarity of the background text, and the color of the background text

Leave a Comment

Your email address will not be published.