http://www.cnblogs.com/bindsang/archive/2008/07/28/1254385.html
Some suggestions for DIV CSS layout
I have been playing with Web refactoring for a while, and I have gained some experience. Netizens often ask Caizi some questions about layout. Some friends in the SvnHost group asked Caizi to write more tutorials about layout to help some novices. Caizi also promised to write more about Caizi’s own experience and experience in layout. Share your experience with everyone.
Many people think that web reconstruction is just a simple DIV CSS layout. This is obviously a wrong concept. I don’t want to explain it more in detail. There are a lot of articles on this aspect. DIV CSS layout is indeed a very important part of reconstruction. Today, Caizi will talk about some suggestions on layout.
In fact, every website designer generally has his own style, so please design a set of layout methods that you like individually, including XHTML and CSS. Please be sure to skillfully remember the dependency relationships between various layout modules. A schematic diagram will be attached at the end of this article.
Maybe you don’t need to define separate styles for each module in CSS at the moment, but do you dare to say that you won’t need it in the future? If you are not sure, please add ID. And please understand that the ID mark is not only for the convenience of defining its style in CSS, it is also a DOM node. For future expansion, this ID is also very necessary.
Many people may have questions about this. Don’t we even need to use tags like span, ul, li, p, h1, h2...? Of course not, please see clearly, Caizi refers to the layout, and these tags are just containers for some content that need to be used to render some effects, and have nothing to do with the layout.
This point is a bit hard to explain, so please read this article: Clever use of uncommon tag elements in XHTML, that’s about it.
No matter what code it is, whether it is XHTML, CSS, JS, or background program code, it all applies. For example, in the XHTML code, a comment is added at the beginning of each module to explain what module it is. Please pay attention to the indentation of the nested divs at each level. The next level has one more indentation than the previous level. The structure must be clearly visible at a glance. Please don't be stingy with one or two blank lines between each module. If you do these things, you will find that whether you look at the source code yourself or others look at the source code, it will be easy to get started. If you need to modify it, , will greatly improve efficiency.
Development documents are some key points in the development process, which must be recorded, such as the directory structure (if necessary, it is best to record the functions of each directory and file), page layout, etc., so that you can conveniently record them at any time After reading it, if someone needs to change people to do this project in the future, it will be easy for them to take over.
That’s all for now, there may be many more things worth noting, I will add them as soon as I think of it, thank you!
Regarding point 1, here is a layout diagram of a corporate website that Caizi helped people make some time ago:
This is a typical layout of three rows and two columns, above It is the header, the middle is content, the middle is divided into left and right parts (sidebar and main), and the bottom is footer. The big structure is very clear and no further explanation is needed. Let’s take a rough look at how the specific layout is:
The outermost layer of the website is a large container #wrap, and all the content is packed inside. As long as its width is defined, the whole situation will take effect. It is recommended to define an outer container in this way. layer container.
The top is the header container, which has three modules, divided into upper and lower layers. The upper layer is divided into two left and right modules, logo and banner, and the lower layer is the nav module, which is the menu.
In the middle is the content container, which is divided into two large modules on the left and right, sidebar and main. The sidebar has two upper and lower modules, login and recommend modules, and the main on the right also has two upper and lower modules, ad and product.
The bottom is the footer container.
Finally, a simple source code of the above layout is attached for reference only!
nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The work of the romantic talent, please keep the original address link when reposting, thank you for your cooperation!
Caizi’s Nest: http://www.54caizi.org/

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download
The most popular open source editor
