CSS (1), CSS (
Start to learn css: Create a style first
1. Use DIV settings
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Css:
@ Charset "UTF-8";/* CSS Document * // * defines the DIV element square display */div {width: 200px; height: 200px; border: solid 2px blue; float: left; margin: 4px ;}
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Css
@ Charset "UTF-8";/* CSS Document * // * defines the DIV element square display */div {width: 200px; height: 200px; border: solid 2px blue; float: left; margin: 4px;}/* definition. set the background of the green class to green */. green {background-color: green;}/* definition. set the background of the red class to red */. red {background-color: red ;}
Effect: