Div can define a block (that is, a piece of content), CSS can define the style, we can have different DIV application of different CSS, so as to the layout of the page
#define a style a.A {background-color:Gray; Color:White ;}</style><style>#Define a style B.B {background-color:Gray; Color:Black;}</style><div class="A">#This DIV applies style a"B">#This div applies style bEffect:
Practice: Use DIV + CSS for layout
<! DOCTYPE html> # First define CSS (i.e. style)#header {background-Color:black; Color:white; Text-Align:center; padding:5px;} #nav { Line-height:30px; Background-color: #eeeeee; height:300px; width:100px; float: Left; padding:5px; } #section {width:350px; float: Left; padding:10px; } #footer {background-Color:black; Color:white; Clear:both; Text-Align:center; padding:5px; }</style>"Header"># different Div apps with different CSS"nav">London<br>Paris<br>Tokyo<br></div><div id=" Section">London isThe capital city of England. It isThe most populous cityinchThe kingdom,with a metropolitan area's over -million inhabitants.</p><p>standing on the river Thames, London had been a major settlement forthe Romans, who named it Londinium, have millennia,its history going back to its founding.</p></div><div id="Footer">Copyright?w3schools.com</div></body>:
HTML Div+css