Dojo Dijit and HTML5 in Real world applications/CSS/117 reasons why CSS dont work

From PMISwiki
Jump to: navigation, search

The is so many possible errors when working with CSS. In this article I have collected some of the most common mistakes.


Too general declaration

A CSS declaration, that defines behaviour on top level elements may destroy detailed declarations.

detailed.img {
        Padding: 0px;
}
 
fieldset, img {
	border: 1px solid;
	margin: 5px;
	Padding: 10px;
}

This happen if the declaration is placed after detailed declarations.

The order of CSS file declarations are wrong

The last file declared in the header takes preference, and overwrite declarations carried out in files declared earlier.

Don't use the title when declaring a CSS file in the Header

Only the first file will be loaded if two files have a title..

<link rel="stylesheet" href="css/style.css" title="CSS_file1" media="screen">
<link rel="stylesheet" href="css/style.css" title="CSS_file2" media="screen">

Verified in

IE 8, Firefox 3.6.22, Dojo 1.6.1

References

Document History

Version Date Author Status Purpose of update
1 29 Feb 2012 PSA Draft Not released.