Dojo Dijit and HTML5 in Real world applications/CSS/117 reasons why CSS dont work: Difference between revisions

From PMISwiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ The is so many possible errors when working with CSS. In this article I have collected some of the most common mistakes. ==To general declaration== A CSS declaration,...")
 
No edit summary
 
Line 3: Line 3:




==To general declaration==
==Too general declaration==
A CSS declaration, that defines behaviour on top level elements may destroy detailed declarations.
A CSS declaration, that defines behaviour on top level elements may destroy detailed declarations.
   
   
Line 23: Line 23:


==Don't use the title when declaring a CSS file in the Header==
==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..
<syntaxhighlight lang="html5">
<syntaxhighlight lang="html5">
<link rel="stylesheet" href="css/style.css" name= media="screen">
<link rel="stylesheet" href="css/style.css" title="CSS_file1" media="screen">
 
<link rel="stylesheet" href="css/style.css" title="CSS_file2" media="screen">
</syntaxhighlight>
</syntaxhighlight>


Line 33: Line 33:


==References==
==References==
* [http://www.mediawiki.org/wiki/Help:Magic_words Help:Magic_words]
 


==Document History==
==Document History==
Line 45: Line 45:
|-
|-
| 1
| 1
| 14 Feb 2012
| 29 Feb 2012
| PSA
| PSA
| Draft
| Draft
Line 58: Line 58:


[[Category:software development]]
[[Category:software development]]
[[Category:HTML5]]
[[Category:CSS]]
[[Category:Dojo]]
[[Category:dojo.addOnLoad]]
[[Category:Dojox]]
[[Category:Dijit]]
[[Category:Dijit]]
[[Category:dijit.form]]

Latest revision as of 00:16, 2 March 2012

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.