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 ... |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| Senior Member Join Date: Jan 2009
Posts: 974
Thanks: 56
Thanked 11 Times in 11 Posts
![]() |
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. |
| | |
| | #2 |
| Member Join Date: Jan 2009 Location: Las Vegas, Nevada
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
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 |
| | |
| | #3 |
| Senior Member Join Date: Jan 2009
Posts: 974
Thanks: 56
Thanked 11 Times in 11 Posts
![]() |
Thank you. Will all browsers ever be equal in the way it deals with the box model?
|
| | |
| | #4 |
![]() Join Date: Jan 2009 Location: Or-Yehuda, Israel
Posts: 428
Thanks: 1
Thanked 20 Times in 20 Posts
![]() ![]() ![]() Expertise: (X)HTML / CSS Experience: Quite Good | 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) |
| | |
| | #5 |
| Senior Member Join Date: Jan 2009
Posts: 974
Thanks: 56
Thanked 11 Times in 11 Posts
![]() |
Thanks for those Shalom. I have bookmarked them and will read them in full soon.
|
| | |
| | #6 |
| Member Join Date: Jan 2009 Location: 127.0.0.1
Posts: 113
Thanks: 1
Thanked 6 Times in 6 Posts
![]() Expertise: (X)HTML / CSS Experience: Expert | The Holy Grail is a great read.
|
| | |
| | #7 |
| Member Join Date: Jan 2009 Location: Las Vegas, Nevada
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
You gotta love A List Apart, that website is an awesome site!
|
| | |
| | #8 | |
| Member Join Date: Jan 2009 Location: Kent, UK
Posts: 147
Blog Entries: 4 Thanks: 0
Thanked 1 Time in 1 Post
![]() | Quote:
| |
| | |
| | #9 |
| Junior Member Join Date: Mar 2009
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
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. |
| | |
![]() |
| Tags |
| box, css, model, needed, tutorial |
| Thread Tools | |
| Display Modes | |