Tutorial needed on CSS Box Model

This is a discussion on Tutorial needed on CSS Box Model within the Design & Layout forums, part of the Web Design category; I want to know the ins and outs of the CSS box model without so much detail I end up ...


Reply
 
LinkBack Thread Tools Display Modes
Old 27th January 2009, 10:07 PM   #1
Senior Member
 
Join Date: Jan 2009
Posts: 974
Thanks: 56
Thanked 11 Times in 11 Posts
Michael is on a distinguished road
Default Tutorial needed on CSS Box Model

I want to know the ins and outs of the CSS box model without so much detail I end up confused. A tutorial which is newbie friendly.

Hope someone knows of one or has their own article on this.
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 27th January 2009, 10:49 PM   #2
Member
 
Join Date: Jan 2009
Location: Las Vegas, Nevada
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Brian is on a distinguished road
Default

This isn't a tutorial, but this is a good resource explaining the box model and hence one of the reasons for the: * {margin:0; padding:0;}

CSS2 - Box model tweaking
Brian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 27th January 2009, 10:56 PM   #3
Senior Member
 
Join Date: Jan 2009
Posts: 974
Thanks: 56
Thanked 11 Times in 11 Posts
Michael is on a distinguished road
Default

Thank you. Will all browsers ever be equal in the way it deals with the box model?
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 27th January 2009, 11:04 PM   #4
supermod
 
shalom_m's Avatar
 
Join Date: Jan 2009
Location: Or-Yehuda, Israel
Posts: 428
Thanks: 1
Thanked 20 Times in 20 Posts
shalom_m has a spectacular aura aboutshalom_m has a spectacular aura aboutshalom_m has a spectacular aura about
Expertise: (X)HTML / CSS
Experience: Quite Good
Default

Concise version

Intermediate version

All you ever will want to know about CSS Box Models (dont forget to look at part one of the article too)
shalom_m is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 27th January 2009, 11:13 PM   #5
Senior Member
 
Join Date: Jan 2009
Posts: 974
Thanks: 56
Thanked 11 Times in 11 Posts
Michael is on a distinguished road
Default

Thanks for those Shalom. I have bookmarked them and will read them in full soon.
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 28th January 2009, 08:12 AM   #6
Gaz
Member
 
Gaz's Avatar
 
Join Date: Jan 2009
Location: 127.0.0.1
Posts: 113
Thanks: 1
Thanked 6 Times in 6 Posts
Gaz is on a distinguished road
Expertise: (X)HTML / CSS
Experience: Expert
Default

The Holy Grail is a great read.
Gaz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 28th January 2009, 03:46 PM   #7
Member
 
Join Date: Jan 2009
Location: Las Vegas, Nevada
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Brian is on a distinguished road
Default

You gotta love A List Apart, that website is an awesome site!
Brian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 28th January 2009, 10:02 PM   #8
Member
 
bonnit's Avatar
 
Join Date: Jan 2009
Location: Kent, UK
Posts: 147
Blog Entries: 4
Thanks: 0
Thanked 1 Time in 1 Post
bonnit is on a distinguished road
Default

Quote:
Originally Posted by shalom_m View Post
excellent links :)
bonnit is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 13th March 2009, 05:51 AM   #9
Junior Member
 
Join Date: Mar 2009
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
designgenies is on a distinguished road
Default Tutorial for CSS Box Model

The box model in CSS describes the boxes which are being generated for HTML-elements. The box model also contains detailed options regarding adjusting margin, border, padding and content for each element. The diagram below shows how the box model is constructed:
The box model in CSS



The illustration above might seem pretty theoretical to look at, so let's try to use the model in an actual case with a headline and some text. The HTML for our example is (from the Universal Declaration of Human Rights):

<h1>Article 1:</h1>

<p>All human beings are born free
and equal in dignity and rights.
They are endowed with reason and conscience
and should act towards one another in a
spirit of brotherhood</p>


By adding some color and font-information the example could be presented as follows:

The example contains two elements: <h1> and <p>. The box model for the two elements can be illustrated as follows:

Even though it may look a bit complicated, the illustration shows how each HTML-element is surrounded by boxes. Boxes which we can adjust using CSS.
designgenies is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Reply

Tags
box, css, model, needed, tutorial

Thread Tools
Display Modes