As simple as it is, I can never remember the syntax for defining a block of css within html. It is of course better practice to put your css in a seperate file and reference it. However, here is sample snippet to define internal style(s):
-
"text/css"
-
body {color: blue}
-
a {color: blue; font-weight:bold;}
-
#id_comment {width: 100px;}
And if you change your mind, here is a sample with the css in its own file:
-
"stylesheet""text/css""thestyle.css"
Why are Internal Style Sheets helpful?
If you are a developer and you like taking shortcuts. Your html designer is not going to approve, but just tell him that it's a beta.
Speaking on which, It's also good for testing. Most recently, I was using a third party Django comments module that had some style that I wanted adjusted. Instead of hunting down the source, the quick test was to define the needed style adjustments right before the tag.
Sun, Mar 22, 2009
Tech Tips