Now that we've where to add CSS rules, we'll start with some basic ones for affecting the presentation of text in our documents.
On the previous page we saw that the color property was what to change to affect the color of text in a given HTML element. In the previous example a simple color name like blue was given for the color. Generally, you'll want to use RGB values to identify colors.
An RGB value, standing for Red, Green, and Blue, is composed of 6 hexadecimal numbers (base-16 numbers) which follow a pound sign, like: #00ff33
. Hexadecimal digits include 0-9 like decimal digits, but they also include a-f to get to 16 digits total.
The first two digits give the intensity value of the color's red component, the second pair digits the intensity of the green component, and the last pair of digits gives the intensity of the color's blue component. So, for the number given above, we'd get a color like: #00ff33. Now, here's an example of the rule in use again:
<html> <head> <title> Title of my webpage </title> <style type="text/css">body { color: #1f00f1; }</style> </head> <body> The content of the page goes here. </body> </html>
Two other quick things we can do with text: change its decoration with the text-decoration property and change its alignment with the text-align property. For the text-decoration property the main values are none (basic text), underline, overline, and line-through. For the text-align property the values are left, right, center, and justify. The first 3 properties move the text to the 3 positions you would expect. The justify value is used to make the text fill its text evenly so you get straight margins on both the left and right sides. Try modifying these two properties and see what affects you get.