this to solve multiple div alignment when the spacing is not right,The principle of clear float can be found in [how to clear Floatswithout Structural Markup]Add the following code to the global CSS and add class= "Clearfix" to the div that needs to be closed.Code:Iii. other compatibility tips (quite useful)Setting padding to
1.IE8 compatibility issues, this best deal, converted into IE7 compatible can be. Add the following piece of code to the head, and then as long as it is compatible under IE7, IE8 below is also compatible2.flaot floating caused IE6 double margin problem, this is the most common, but also best to deal with,!important solve, such asmargin-left:10px!important;margin-left:5px;+height:120px;5. Sometimes, in the layout of the time, found that there is a div
Css
One months, I'm back, okay, let's keep talking.
In the previous article, the main negation of the use of Div layout this argument, the proposed div should be used to organize the code structure, now we go a little deeper, Div has semantics? The question was hotly debated in the study group some time ago, when Rice
Add a background to a text entry box-www.cxybl.com Text box is there a beautiful background here? In fact, it is very simple, using CSS to define the background image can be, and then applied to this object, haha ha! I hope you like it.
This article links http://www.cxybl.com/html/wyzz/
plan your page structure, you may get a few pieces like this:
Logo and site name
Homepage content
Site Navigation (main menu)
Sub-menu
Search box
Functional area (such as shopping cart and cashier)
Footer (copyright and relevant legal disclaimer)
We usually use DIV elements to define these structures, like this:
This is not a layout, but a structure. This is a semantic description of conten
Examples of css box models and css box models
1. Overview of the css Box Model
1> let's take a look at w3c overview.
2> In fact, each element of css is a
standard usage in Web page making Div+css naming rules that can improve the effectiveness of optimization especially when teamwork can provide collaborative production efficiency, specific DIV CSS Naming conventions css naming encyclopedia content article. Common
A pure css-implemented beautiful navigation, css-implemented navigation
Today we will share with you a beautiful navigation that is implemented with pure css. I have previously shared with you the personal center navigation menu implemented by jquery. Today, this is also sui
display modeRep: Div P li ul ol dl ...Characteristics:1. Take a separate line (more overbearing) top-down display2. Height and width can be setPS: After assigning a wide background to the box, the entity can be displayed, which we call manifested.1.4.2 in-line display modeRep: span Font b i em a ....Characteristics:1. Display in one line. Display from left to right.2. The width and height cannot be set.1.4
selector a "#", the difference between the ID and class is: ID does not allow two of the same ID, the display effect is as follows: Declaration of CSS for css There are three kinds, collective declarations, Global declarations and nested declarations, see below two examples: The effect is as follows: bottom This example is a nested declaration, can help us find the exac
css| Design | Web page design
Used div+CSS as a whole site, if it is pure div layout is more troublesome, especially you div nested div, div layout, you have some page effect or to disc
Use css layout box-sizing and css layout box-sizing
Div {
Box-sizing: border-box;
Width: 200px;
Padding: 20px;
Border: 1px solid red;
}
This section of
(-50%);CSS3 variable width High level vertical CenterAs long as three words can realize the indefinite wide high level vertical center.justify-content:center;//child elements are centered horizontally align-items:center;//the child elements are vertically centered display:-webkit-flex;Adding the above 3 sentences to the parent element allows the child element to be horizontally vertically centered.Use Margin:auto for vertical centeringThe value of margin is set to auto, allowing us to allocate
CSS page layouts should avoid abusing DIV elements that have been advocated by us, and organizing documents with appropriate HTML tags is the basis for CSS page layouts.
The use of DIV and span elements in a page is a new problem and we can easily use them too much. The necessary and reasonable use of
insert a space in the menubar. 9. The box model in Mozilla Firefox and IE does not explain inconsistencies resulting in 2px resolution: div{margin:30px!important;margin:28px;} Note that the order of the two margin must not be written in reverse, according to the statement of AH-jie! Important This property IE is not recognized, but other browsers can recognize it. So in the case of IE is actually interpret
structure is divided into the H series. So small? Here is another concept that involves DIV: block-level elements. What block? Module! Small with Div modularity. Example:
This example in [complex form], let's take a detailed analysis of how div is used in small modules. In fact, it is very simple, h3/lable/p is the semantic structure, then, for the user name an
div CSS text font line Gao Xing distance depth understanding CSS Line spacing settingsdiv CSS text font line Gao Xing distance DIVCSS5 takes you in-depth understanding of CSS line spacing settings, how font spacing is most easily set.In the article, to achieve the adjustment
CSS Compatibility common skills
Please try to write code in strict XHTML format, must add DOCTYPE declaration, because DOCTYPE affect the CSS processing, affect the standard of the consortium.
Vertical center of text in 1.div
Vertical-align:middle; Increase line spacing to be as high as the entire Div line-height:20
css| Design | Web page design
Used Div+css as a whole site, if it is pure div layout is more troublesome, especially you div nested div, div layout, you have some page effect or to disc
page font more beautiful and easier to orchestrate, so that the page is truly pleasing to the eye.
17. You can easily control the page layout.
18. You can update the style formats of many web pages at the same time without updating them one page at a time. You can use a CSS file to control all the webpage styles on the site. As long as you modify the corresponding lines in the
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.