CSS Basics – The Box Model

CSS Basics – The Box Model

Learning how to design using Cascading Style Sheets (CSS) can be a little tricky for the beginner if you don’t figure out a few of the basics. One of the basic concepts in CSS is the box model. CSS is the code that is used to define design in most modern web pages. WordPress Blogs [...]

Author : Simon

Author's Website | Articles from Simon

The creator of Pingable. We write about everything Wordpress.

CSS Box Model

Learning how to design using Cascading Style Sheets (CSS) can be a little tricky for the beginner if you don’t figure out a few of the basics. One of the basic concepts in CSS is the box model.

CSS is the code that is used to define design in most modern web pages. WordPress Blogs and Myspace layouts both require CSS.

The above diagram explains how The Box Model works. The entire diagram represents a single Div element in CSS. So if the div was the main text of a page, the width and height would define the area which text will fill. The padding would define the area between the text and the border. And the margin would define the area between the border and the next div element on the page. I hope this basic tutorial helps.

www.pingable.org

-->
Use the same Wordpress theme as us:


User Comments


  1. Jack from Lionel Trains
    May 13, 2010

    Thanks for your breakdown of css styles. Your diagram of the box model is gonna save me a bunch of headaches when I try and edit the code on wordpress stylesheets lol. I’ve already encountered the white screen of death screwing around…



  2. Bob Jenson from Web Design New Zealand
    June 4, 2010

    Thanks for this, I’m always having a nightmare with CSS. At least I’m finally not giving up and using tables instead.

    One of the hardest things I had to work out was a div with a background that automatically expanded with the content (so you have a top left, top right corners etc).


Leave a Reply


Comment Policy: This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage. Comments that use keywords in the name field in the incorrect format will not be approved. Links to inappropriate sites will also not be approved. Do not bother wasting my time by thanking me for a post. Add something to the discussion or your comment will be deleted

Additional comments powered by BackType

Rss Feeds   Twitter Followers Email Updates