23. March 2010 09:29
CSS Text Properties
Not too long ago when I was first taught HTML, there was a collection of tags used to format the text. There were tags for making text italic, bold, underlined, and so on. Now if you look on other web design sites, all of those tags are not considered good practice to use anymore. “Deprecated” is the term you see thrown out a lot of times, for HTML tags that they don’t want you to use anymore. Though the tags are still supported by browsers, but who knows for how long? Everything is now aimed at CSS styles. That is why I’ve been going into the last two posting with CSS. And for those like me, who need a refresher course, here we are.
From the HTML Tags to their CSS counterpart, a few examples.
Center: <center> to text-align:center;
Underline: <u> to text-decoration:underline;
Strikeout: <s> to text-decoration:line-through;
The CSS styling is cleaner for the html code. You don’t have to confuse yourself with a mess of nested font styling tags. So the text properties available for CSS styling include:
- color—Naturally it sets the color of text
- direction—You can set the direction of the text from left to right to right to left.
- line-height—How much space you want to go between the lines.
- letter-spacing—Change the amount of spacing between letters.
- text-align—left, center, right, justify
- text-decoration—Here you will insert all of the classic decorations, such as underline, overline, line-through, none, and blink (Which is not supported by IE, it was originally a Netscape tag.)
- text-shadow—gives a shadow to the text. Options are none, color, and length.
- text-transform—Choose how the letters appear, be it none, capitalized, uppercase, or lowercase.
- vertical-align—Set how the element aligns on the page. Options are baseline, sub, super, top, text-top, middle, bottom, text-bottom, length, and % (percentage).
- white-space—Configure the ways in which white space in your page element will appear. Choices are normal, pre, and nowrap.
- word-spacing—You can set the gaps between words, options are normal and a specified length.
d9e2e642-81c8-4341-adf9-0765169a7d58|0|.0