Home  >  Article  >  Web Front-end  >  CSS Web Page Layout Introductory Tutorial 7: Two Columns with Fixed Width Centered_Basic Tutorial

CSS Web Page Layout Introductory Tutorial 7: Two Columns with Fixed Width Centered_Basic Tutorial

WBOY
WBOYOriginal
2016-05-16 12:07:141398browse

In one column of fixed width, we use margin:0px auto; this setting allows a div to be displayed in the center, and in two columns, what needs to be controlled is that the left side of the left column is equal to the right side of the right column. Therefore, using margin: 0px auto; does not seem to be able to achieve a smooth effect. At this time, a nested design of divs is needed to complete. You can use a centered div as a container, and rotate the two divs divided into two columns. In the container, to achieve the display of two columns, combined with the above code, the new XHTML code structure is as follows:

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn