In Web page production, there are many terms, such as CSS, HTML, DHTML, XHTML, and so on. In the following article we will use some basic knowledge about HTML, and before you learn this introductory tutorial, make sure you have a certain HTML base. Let's start with a step-by-step use of DIV+CSS for Web layout design.
All the design first step is the idea, the idea is good, in general also need to use Photoshop or fireworks (hereinafter referred to as PS or FW), such as image processing software will need to make the interface layout simple structure, the following is my idea of the interface layout diagram.
Below, we need to plan the layout of the page according to the idea map, analyze the diagram carefully, we can not find that the picture is roughly divided into the following parts:
1, the top part, including the logo, menu and a picture of banner;
2, the content can be divided into side columns, the main content;
3, the bottom, including some copyright information.
With the above analysis, we can easily layout the design layer as follows:
According to the diagram above, I have drawn an actual page layout diagram to illustrate the nesting relationship of the layer, so it will be easier to understand.
The div structure is as follows:
│body {} /*这是一个HTML元素,具体我就不说明了*/
└#Container {} /*页面层容器*/
├#Header {} /*页面头部*/
├#PageBody {} /*页面主体*/
│ ├#Sidebar {} /*侧边栏*/
│ └#MainBody {} /*主体内容*/
└#Footer {} /*页面底部*/
Now that the page layout and planning are complete, all we have to do is start writing HTML code and CSS.