Start learning CSS Tours: do a style first
First, use div settings
<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>First CSS style</title><Linktype= "Text/css"rel= "stylesheet"href= "Css/test1.css" /></Head><Body><Div></Div><Div></Div><Div></Div><Div></Div></Body></HTML>
Css:
@charset "Utf-8"; /* */* defines the div element square display */{ width:200px; Height:200px; Border:solid 2px Blue; float:left; margin:4px;}
Second, the use of class settings
<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>First CSS style</title><Linktype= "Text/css"rel= "stylesheet"href= "Css/test1.css" /></Head><Body><Div></Div><Div></Div><Divclass= "Green"></Div><Divclass= "Red"></Div></Body></HTML>
Css
@charset "Utf-8";/*CSS Document*//*defining a DIV element square display*/Div{width:200px;Height:200px;Border:Solid 2px Blue;float: Left;margin:4px;}/*define the. Green Setting background*/. Green{Background-color:Green;}/*definition. Red class setting background*/. Red{Background-color:Red;}
Effect:
CSS (i)