Company  |  Online Order  |  Policies  |  xBLOG  |  Help & Support  |  Contact

Archive for November, 2008:

The !important in CSS

When a CSS propriety is specified twice, the browser will commonly use the last one. Let’s see an example:

#main {
width:600px;
width:800px;
}
In this example the browser will assign width 800 pixels to the #main element.
The declaration !important can be used in cascading style sheets to give priority to some parameters.

#main {
width:600px !important;
width:800px;
}
In the example above the browser [...]

Tags: , ,

Leave a Comment


CSS padding problems (IE vs Firefox)

Every HTML element is essentially a box, the width of which is the total of its margin, border, padding and content area. Imagine the following CSS rule:
div {
margin: 5em;
padding: 4em;
border: 1em solid grey;
width: 30em
}
This means that each div is 50em wide in total. This amount is made up of a 30em wide content area, [...]

Tags: , ,

Comments (1)