PHP Learning Eighth day--div with class and ID

Source: Internet
Author: User

The day before yesterday to do the only product will be the Web page, directly led me to accumulate a lot of days very inflated confidence shattered into a piece of slag, div nesting and can not handle all the layout and format, for example:

<div><div><div><<div></div>/div></div></div>, The size of the body itself will make the div overflow condition, float and many other tags will be directly to the Div lost, and in the format, also appears to be very fluid, so how to layout for a page, how to avoid the various div nested each other caused by overflow situation occurs, Is the most serious of making a finished page.

Today, the success of the only product will be the Web page, now a part of the code paste as follows:

<div id= "Main" >

<div class= "Tou" >

<!--the upper part of the page--

<div class= "Zuoshang" >

<a id= "DL" href= "><H1 > Products

<a id= "XL" href= "> a special website for sale </a>

</div>

<div class= "Youshang" >

</div>

</div>



<!--the center of the page--

<div id= "Mid" >

<!--left part--

<div class= "left" ></div>


<!--right Half--


<div class= "Right" >

<div id= "Xiaozi" >

<div class= "Text1" > Welcome registration </div>

<div class= "Text2" > Registered to <a class= "Fen" href= "./denglu.html" > Direct login </a></div>


Still a lot of div nested, but add class and ID in Div, use external style, can shorten the length of the whole code page, because in many cases the style even more than the body, such layout, the entire code page will look very clear, in the future to make changes, It will be easier and more convenient.

Adding comments to numerous Div's will play a very good role.

This article is from the "12244243" blog, please be sure to keep this source http://12254243.blog.51cto.com/12244243/1873597

PHP Learning Eighth day--div with class and ID

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.