HTML Learning Note block Element section III (original)

Source: Internet
Author: User

Block element
Will start with a new line
such as <p>

Inline elements
Does not start with a new line
<b><a>

div element (element type not specified)
(You can set the Div property by using an external index in the CSS file #divid{} to add a tag that needs to be modified before the curly braces)
<div id= "divID" >

span element (specifies that the element type is text type)

Div layout

<! DOCTYPE html>
<meta charset= "UTF-8" >
<title>div Layout </title>
<style type= "Text/css" >
Body {
margin:0px;
}

#container {
width:100%;
height:950px;

}

#heading {
width:100%;
height:10%;

}

#content_menu {
width:30%;
height:80%;

Float:left;
}

#content_body {
width:70%;
height:80%;

Float:left;
}

#footing {
width:100%;
height:10%;

Clear:both;
}
</style>
<body>
<div id= "Container" >
<div id= "Heading" > Head </div>
<div id= "Content_menu" > Content menu </div>
<div id= "Content_body" > Content theme </div>
<div id= "footing" > Bottom </div >
</div>
</body>

Table layout

<! DOCTYPE html>
<meta charset= "UTF-8" >
<title>table Layout </title>
<body marginheight= "0px" marginwidth= "0px" >
<table width= "100%" height= "950px" style= "
<tr>
<TD colspan= "2" width= "100%" height= "10%" style= "This is the head </td>
</tr>
<tr>
<TD width= "height=" 80% "style=" left menu </td>
<TD width= "height=" 80% "style=" right menu </td>
</tr>
<tr>
<TD colspan= "2" width= "height=" 10% "style=" Bottom </td>
</tr>
</table>
</body>

Block element Supplemental margin problem
<! DOCTYPE html>
<meta charset= "UTF-8" >
<title>Title</title>
<body>
<!--padding internal margin margin--
<div style= "border:1px Red dashed;height:600px;width:800px;padding:10px;background-image:url (' CSS box model 3D hierarchy. PNG ') ">
<div style= "border:1px rgb (255,206,68) solid;height:200px;width:200px" >

</div>
<div style= "border:1px Blue solid;height:200px;width:200px;margin:10px;" >
<!--here because there is an inner margin of the outside Div so the margin 10px is now outside div20px-->
<div style= "margin:10px" >asdasdasdas</div>
</div>
</div>
</body>

HTML Learning Note block Element section III (original)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.