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!

Welcome to 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 Advertise on Bucaro TecHelp Advertise Here RSS News Feeds News Feeds

HTML5 Solutions: Essential Techniques for HTML5 Developers

Essential Techniques for HTML5 Developers

HTML5 brings the biggest changes to HTML in years. Web designers now have new techniques, from displaying video and audio natively in HTML, to creating realtime graphics on a web page without a plugin.

This book provides a collection of solutions to all of the most common HTML5 problems. Every solution contains sample code that is production-ready and can be applied to any project.

Click Here

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

Web Design Sections

CSS3: Visual QuickStart Guide (5th Edition)

With this book, readers can start with a tour of the stylesheet language, or skip ahead to any chapter of the book to look up specific tasks covering just what they need to know. This task-based, visual reference guide uses step-by-step instructions, and plenty of screenshots to teach beginning and intermediate users CSS.

Reader David Diez of Boston, MA says, "This book's strategy seems to be show an example, give a general explanation, provide a few key but brief tips, move on. The writing is clear and concise. ... I continue to be very pleased and impressed with the book. It's proving to be a helpful reference and everything in it is highly accessible. Click here for more information.


[Site User Agreement] [Advertise on This site] [Search This Site] [Contact Form]
Copyright©2001-2011 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268