Local Style
<h1 style="text-decoration:underline;text-align:center">Weather Report</h1>
Also known as an "inline style", this method of applying CSS styling is for small changes to a single element through its style attribute, as above. This isn't a stylesheet and there is neither rule nor selector, since the element is "selected" implicitly by virtue of having its style attribute set.
- Don't forget to separate your property-value pairs by semicolons. ;
yeah, it's that important
- If you find that you're applying the same style to multiple elements, consider a class selector.
- If you are applying a fair number of properties to single element, more than two, you might want to give it an id and do an id selector.
Back to Knowledge Dump