CSS Notes and Quick Examples
-
Inherit is a useful CSS value for keeping the font and color of links in a text blob the same as the parent.
-
Cascading Style Sheets seemed easy enough until I tried doing an all CSS layout (see Perceptus.ca). Anyway, this turned out to be a good reference: http://www.w3schools.com/css/css_syntax.asp
-
The link above suggests a CSS definition for "p#para1" if you want to specify the format for paragraphs in the block (?) with an ID of "para1". I seemed to get by ok using a definition for "#para1 p" - works ok in Mozilla and IE. I don't know if it's a proper syntax though.
-
Inline CSS Syntax sample, note NO squigly brackets:
< option style="font-family: 'Lucida Console',monospace;" value="Premium" >Best Choice< /option >
-
CSS image links should be relative to the CSS file. I guess this makes sense... this way a common css file is easier to use across an entire site.
-
Nice CSS Cheat sheet: http://web.tampabay.rr.com/bmerkey/cheatsheet.htm
Of particular use is the graphic of the box model -- spec says that width does NOT include margins or borders or padding. UPDATE: I'm not convinced that the box model example in this page is correct, it seems to conflict with: http://tantek.com/CSS/Examples/boxmodelhack.html
Ok, now I get it, it depends on wether or not IE is in strict mode or quirks mode:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie60/html/cssenhancements.asp
-
Hyperlink underlines in a different color - http://www.hyperlinkcode.com/change-underline-color.php
-
width. Modern IE (NOT IE7-) and other browsers use content-box model - width is the content only; padding and borders and margins are extra - http://stackoverflow.com/questions/4698054/css-does-the-width-include-the-padding - http://www.w3schools.com/css/css_boxmodel.asp
tags: css, style
>>
Leonard Chan's Homepage
>>
Scribble Web
>> CSS Notes and Quick Examples