DIV+CSS layout

Source: Internet
Author: User

1.div and span (in order to apply CSS styles)

span is an inline style (only part of the content that exists)

Div is a block-level element (takes up a whole line)

2. Box model

Margin: Box margin

padding: Inner margin of box

Border: Box Border width

Width: Box widths

Height: Box height

3. Layout-related properties

1) Position Positioning method

Normal Position: Relative

To locate according to the parent window: absolute

Positioning according to the browser window: fixed (often used to make a floating window, relative to the browser location has remained unchanged)

No positioning: Static

Inheritance: Inherit

2) Positioning

Distance from page point: Left, right, top, bottom

3) Layer Overwrite order (priority)

Z-index: As a number, the default is 0, the larger the number the more upward

4) Display Properties: Displays

None: Layer does not display

Block: Block display, wrap after element, show next element

Inline: Inline display, multiple blocks can be displayed in one line

(inline elements cannot define widths and can be converted between Div and span using block and inline two properties)

5) Float Property: float

Left: Floating

Right: Floating

6) Clear Float

Clear:both

7) Overflow Handling: Overflow

Hidden: Hide content beyond the layer size

Scroll: Add scroll bar regardless of whether the content exceeds the layer size

Auto: Automatically add scroll bar when out of bounds

4. Make the page hold center display:

body{

margin:0 Auto;

}

5. Compatibility issues

1) Compatibility Test tool

IE Tester, Multibrowser

2) commonly used browsers

Google Chrome, Firefox, Opera

3) Efficient development tools

notepad++, Sbulime Text, Notepad

Webstorm, Dreamweaver

4) Web Design tools

Fireworks, Photoshop

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.