__x__ (20) 0907 the fourth day __ CSS box model

Source: Internet
Author: User

CSS handles elements that contain each element in a single box.

The layout of the Web page, in fact, is the box placement and settings.


The frame border will make the box larger:

.box{
    border: 10px 20px 30px 40px red solid;
}

.box{
    border-width: 10px 20px 30px 40px;
    border-color: red;
    border-style: solid;
}

BORDER-TOP-XXX:

BORDER-RIGHT-XXX:

BORDER-BOTTOM-XXX:

BORDER-LEFT-XXX:


Border-style:

None Default No Border

Solid Straight frame

dotted; Dot-Shaped Box

Dashed; Dashed box

Double Two-wire frame

Groove The following effects depend on the Bordr-color

Ridge

Inset

outset;

Inhert; inherit.



The inner margin padding, will make the box bigger, will be affected by the Background-color

padding:100px 200px 300px 400px;

Equivalent

padding-top:100px;

padding-right:200px;

padding-bottom:300px;

padding-left:400px;

Margins margin, does not affect the size of the visible box, only affects the position of the box ... Left and top affect their position, right and bottom affect the position of other elements

margin:200px;

Equivalent

margin-top:200px;

margin-right:200px;

margin-bottom:200px;

margin-left:200px;

Attention:

Can be negative, that is, move in the opposite direction.

Margin-left:auto; Right in the parent element

Margin-right:auto; Left in parent element


__x__ (20) 0907 the fourth day __ CSS box model

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.