DIV+CSS layout

Source: Internet
Author: User

650) this.width=650; "style=" Float:none; "title=" 01.jpg "src=" http://s3.51cto.com/wyfs02/M02/49/E9/ Wkiom1qfwcpiewdwaacz5c88nbc896.jpg "width=" 319 "height=" 365 "alt=" Wkiom1qfwcpiewdwaacz5c88nbc896.jpg "/>650) this.width=650; "style=" width:351px;height:363px; "title=" 02.jpg "src=" http://s3.51cto.com/wyfs02/M00/49/EB/ Wkiol1qfweltkic4aabz4am27ve324.jpg "width=" 368 "height=" 359 "alt=" Wkiol1qfweltkic4aabz4am27ve324.jpg "/>

Make a Web page first from the layout, a page divided into four pieces, with Div block layout, block painting, Open is a blank, div just will block the page, but to show the size of the block color, we need to use CSS to control, the following div is set to a width of 300px, the height of 200px, the background color is blue , the effect is as follows:

650) this.width=650; "title=" 03.jpg "src=" http://s3.51cto.com/wyfs02/M01/49/EB/wKioL1QfW4PBKu8mAAGyWG4uzOQ693.jpg "Width=" 599 "height=" 388 "alt=" wkiol1qfw4pbku8maagywg4uzoq693.jpg "/>

So why is this show is a big chunk, because, I will set the background color is the same, then do not want to connect the four pieces of a piece, then we will be the following four Div is named after a name, and then by the name we then use CSS to change the background of four Div.

650) this.width=650; "style=" width:629px;height:348px; "title=" 04.jpg "src=" http://s3.51cto.com/wyfs02/M01/49/E9/ Wkiom1qfxr2y2zs1aai41hgakxe152.jpg "width=" 625 "height=" 311 "alt=" Wkiom1qfxr2y2zs1aai41hgakxe152.jpg "/>

So from the above can be seen four has been separated by blue, green, red and gray to distinguish, you can see that is not a piece of it, then why the first Div is still blue, this is because the CSS inside the first div style will be so the body of the div set blue, we will then two, three or four blocks , these three pieces deliberately used the other three colors, but the first piece we did not deliberately to set the color, so the first block is still blue, four points out, but the four block and we want the effect is not the same as a little wider and not filled the entire page, we previously set the div width 300px, then we will " width:300px; " Delete, let's look at the effect:

650) this.width=650; "style=" width:715px;height:342px; "title=" 05.jpg "src=" http://s3.51cto.com/wyfs02/M02/49/E9/ Wkiom1qfyagcqon0aairj-guitu492.jpg "width=" 476 "height=" 291 "alt=" Wkiom1qfyagcqon0aairj-guitu492.jpg "/>

Now, the width of the four block is filled with the entire page. This allows the simplest layout to be achieved.

This article from "Don't Make good" blog, declined reprint!

DIV+CSS layout

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.