Positioning CSS elements.

In this section I will explain how to position CSS elements.

CSS positioning
(more…)

DiggFacebookMySpaceTwitterTechnorati FavoritesEvernoteDeliciousShare
Tagged with: boxCSSpositioningtutorial
 

CSS Margin Collapsing

Maybe many guys out there, when they start to learn how to use CSS, don’t know that when two or more vertical margins meet in a layout, they collaps to form a single margin. Which will be the height of this margin? simple.. the larger of the two margins.

This is true only for block boxes, in the normal flow of the document (not for inline, floated, absoluted positioned boxes..).

This is the case for example of two elements vertically aligned:

Margin collapsing tutorial

The result will be the following:

Margin collapsed

(more…)

DiggFacebookMySpaceTwitterTechnorati FavoritesEvernoteDeliciousShare
Tagged with: boxCSSmarginstutorial
 

CSS BOX Model.

One of the most important thing to understand about CSS is the Box Model. The Box Model how elements are displayed. Every element that we use in the page is considered to be a rectangular box. The properties for this box are as follow: content, padding, border and margin.

You can understand how this element interact from the following visual representation:

CSS BOX Model

(more…)

DiggFacebookMySpaceTwitterTechnorati FavoritesEvernoteDeliciousShare
Tagged with: bordersboxCSSmarginspaddingtutorial