Monday 14 January 2008

Css

Today we learnt about style sheets and about how they work, and how to use them to create web pages that all comform to the same layout, we also learnt about how to make a page fit the screen width but scroll down as far as is needed. I think this is useful and would be good to myself, i think it will be better for large coporate websites.

"The term "box model" is often used by people when talking about CSS-based layouts and design. Not everyone understands what is meant by this though, and not everyone understands why it is so important. Any HTML element can be considered a box, and so the box model applies to all HTML (and XHTML) elements. The box model is the specification that defines how a box and its attributes relate to each other. In its simplest form, the box model tells browsers that a box defined as having width 100 pixels and height 50 pixels should be drawn 100 pixels wide and 50 pixels tall. There is more you can add to a box, though, like padding, margins, borders, etc. This image should help explain what I'm about to run through:

As you can see, a box is made up of four distinct parts. The outside one, the margin, is completely invisible. It has no background color, and will not obstruct elements behind it. The margin is outside the second part, which is the border. The border outlines the visible portion of the element. Inside the border is the third part of the box, the padding, and then inside that the content area of the box. The padding defines the space between the content area of the box and the border."

No comments: