One of the most important CSS webpage layout concepts to understand is the box model. Every element on a webpage is actually a rectangular box. Exactly how a box will display depends upon the positioning method used, which other CSS properties you set for the box and how you select the box.
Welcome to Bucaro TecHelp!

Bucaro TecHelp
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact RSS News Feeds News Feeds

Victims of Sandy Hook

Stop the Slaughter of Innocents. Congress is bought and paid for by gun lunatics and gun promotion groups. If you want to live in a safe America, help buy Congress back for America. Send a donation to Mayors Against Illegal Guns, 909 Third Avenue, 15th Floor New York, NY 10022

The CSS Box Model

One of the most important CSS webpage layout concepts to understand is the box model. Every element on a webpage is actually a rectangular box consisting of a content area surrounded by a border. The border is invisible because, by default, its width is set to 0. You can make the border visible by setting the boxes border-style property to solid or one of the other available styles.

The CSS Box Model

Padding

The area between a boxes content area and its border is its padding. By default the padding is set to 0. You can use the padding property to set the size of the padding area. Padding cannot be set to negative values.

Text in the boxes content area

<span style="border-style:solid; padding:10px;">
Text in the boxes content area
</span>

If you set a background color or background image for a box, it will appear within the content area and padding area.

Content Area
Content Area
Content Area
Content Area


<style type="text/css">
.box1
{
float:left;
padding:4px;
margin:4px;
border-style:solid;
border-width:1px;
background-color:#ba55d3;
}
</style>

<div class="box1">Content Area</div>
<div class="box1">Content Area</div>
<div class="box1">Content Area</div>
<div class="box1">Content Area</div>

The CSS Box Model is NOT Consistently Implemented

Exactly how a box will display depends upon the positioning method used, e.g. fixed, relative, inline, block, float, etc. It also depends upon which other CSS properties you set for the box and how you select the elements they apply to, e.g. inline, class, id, etc. It is therefor important to test your layout with Internet Explorer, Firefox, and any other browsers for which you desire to be compatible.



RSS Feed RSS Feed


Follow Stephen Bucaro Follow @Stephen Bucaro


Web Design Sections

Fire HD
[Site User Agreement] [Privacy Policy] [Site map] [Search This Site] [Contact Form]
Copyright©2001-2016 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268