Monday, 16 February 2015

THE TEXT DECORATION PROPERTY

The text-decoration property is used to specify which, if any, decoration will be applied to the text within the affected tag. the valid valued for this property are underline, over line line-though, and blink. The application of each of them is self-explanatory. However, here’s an example that demonstrates how to use e ach of them:

INPUT

<p>here is some <span style=’text-decoration: underline “underlined text </span>,</p>

<p> here is some <span style=”text-decoration: over line”>over  lined text</span>,</p>

<p>here is some <span style=”text-decoration: line-through”> line-through text</span>.</p>

<p>here is some<span style=”text- desecration: blink”>blinking text</text</s[am>.</p>

Using <span> and the text-decoration property to underline text is no different from using the <u>tag, except that some old browsers that don’t support CSS might not support it. The cool thing is that you can use this, and all the properties you’ll see in today’s lesson, with any tag that encloses text. Take a look at this example:

<h1> style=”text-decoration: underline”> an under lined heading </h1>
Using the style attribute, you can specify how the text of the heading appears. Choosing between this approach and the <u>tag is a wash-if you want to remove the underlining from the heading, you’d have to come back and edit the tag itself, regardless of whether you used the <u>tag or style attribute. Later, you’ll see how style sheets can be used to control the appearance of many elements at once.

FONT PROPERTIES

When you want to modify the appearance of text, the other major family of properties you can uses font properties\. Font properties can be used to modify pretty much any aspect of the type used to render text in a browser. One of  the particularly nice things about font properties is that they’re much more specific than the tags that you’ve seen so far.

First, let’s look at some of the direct replacements for tags you’ve already seen the font style property can be used to italicize text . it has there possible values, normal, which is the default, italic, which renders the text in the same way as the <iu> tag, and oblique, which is somewhere between italic and normal, and is not as well supported browsers as the italic style is. Here are some example:

Input

<p>here’s some <span style=”font-style: italic”>italicized text</span>.</p>

<p>here’s some <span style=”font-style: oblique “oblique text</p>

(which may look like regular italics in your browser),</p>

now let’s look at how you use css to create boldfaced text. in the world of html, thee are two option: bold and not bold, with css, you have (theoretically)many more options. the reason i say theoretically is that browser support for the wide breadth of font weights available using CSS can be spotty. to specify that text should be boldface, the font-weight property is used. Valid values are normal (the default), bold, bolder, lighter, and 100through 900, in units of 100. Here are some examples:


No comments:

Post a Comment