<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Block and inline </title>
<style type= "Text/css" >
body,div,a,span{
margin:0;
padding:0;
}
#content {
Background: #CCFFFF;
width:300px;
height:300px;
}
#content_1 {
Background: #ccc;
width:100px;
height:100px;
display:inline;<!--make block element div inline, width and height do not work--
}
#content_2 {
Background:pink;
width:100px;
height:100px;
display:inline;<!--make block element div inline, width and height do not work--
}
span{
display:block;<!--to turn inline element span into a block, that is, let a exclusive line--
}
</style>
<body>
<div id= "Content" >
<div id= "Content_1" >
Small box 1
</div>
<div id= "Content_2" >
Small Box 2
</div>
<a href= "http://www.baidu.com" target= "_blank" > Baidu </a>
</div>
<span> Exclusive Line </span>
<a href= "http://www.hao123.com" target= "_blank" >hao123</a>
</body>
18_ block elements and inline elements. html