Results 1 to 5 of 5
Thread: CSS to the Rescue
-
05-18-2012, 08:16 AM #1
MTV Newbie
This user has no status.I am:----
- Join Date
- May 2012
- Posts
- 17
- MTV$
- 31
CSS to the Rescue
The problem of polluting HTML with presentational markup was not lost on the World Wide Web Consortium (W3C), which began searching for a quick solution. In 1995, the consortium started publicizing a work-in-progress called CSS. By 1996, it had become a full Recommendation, with the same weight as HTML itself. Here's why.
Rich Styling
In the first place, CSS allows for much richer document appearances than HTML ever allowed, even at the height of its presentational fervor. CSS lets you set colors on text and in the background of any element; permits the creation of borders around any element, as well as the increase or decrease of the space around them; lets you change the way text is capitalized, decorated (e.g., underlining), spaced, and even whether it is displayed at all; and allows you to accomplish many other effects.
Take, for example, the first (and main) heading on a page, which is usually the title of the page itself. The proper markup is:
<h1>Leaping Above The Water</h1>
Now, suppose you want this title to be dark red, use a certain font, be italicized and underlined, and have a yellow background. To do all of that with HTML, you'd have to put the h1 into a table and load it up with a ton of other elements like font and U. With CSS, all you need is one rule:
h1 {color: maroon; font: italic 2em Times, serif; text-decoration: underline;
background: yellow;}
That's it. As you can see, everything you did in HTML can be done in CSS. There's no need to confine yourself to only those things HTML can do, however:
h1 {color: maroon; font: italic 2em Times, serif; text-decoration: underline;
background: yellow url(titlebg.png) repeat-x;
border: 1px solid red; margin-bottom: 0; padding: 5px;}
You now have an image in the background of the h1 that is only repeated horizontally, and a border around it, separated from the text by at least five pixels. You've also removed the margin (blank space) from the bottom of the element. These are feats that HTML can't even come close to matchingand that's just a taste of what CSS can do.
-
05-18-2012 08:16 AM # ADSAdvertise here Circuit advertisement
- Join Date
- My Birthday
- Posts
- Million and counting
-
09-10-2012, 06:52 AM #2
Banned
is who wander are lost!!!I am:
- Join Date
- Sep 2012
- Posts
- 1,704
- MTV$
- 5,031
Re: CSS to the Rescue
Now, suppose you want this title to be dark red, use a certain font, be italicized and underlined, and have a yellow background. To do all of that with HTML, you'd have to put the h1 into a table and load it up with a ton of other elements like font and U. With CSS, all you need is one rule:
h1 {color: maroon; font: italic 2em Times, serif; text-decoration: underline;
background: yellow;}
That's it. As you can see, everything you did in HTML can be done in CSS. There's no need to confine yourself to only those things HTML can do, however:
h1 {color: maroon; font: italic 2em Times, serif; text-decoration: underline;
background: yellow url(titlebg.png) repeat-x;
border: 1px solid red; margin-bottom: 0; padding: 5px;}
You now have an image in the background of the h1 that is only repeated horizontally, and a border around it, separated from the text by at least five pixels. You've also removed the margin (blank space) from the bottom of the element. These are feats that HTML can't even come close to matchingand that's just a taste of what CSS can do.
-
09-10-2012, 11:11 PM #3
MTV Regular
is back to MTVI am:
- Join Date
- Aug 2012
- Location
- kathmandu, nepal
- Posts
- 281
- MTV$
- 283
Re: CSS to the Rescue
owo this is really a cool information on html . This is really a meaning ful thing and makes alots of sense being here in this forum . Thank you friend for posting such great task here . keep it up .
-
09-12-2012, 10:52 AM #4
Banned
is who wander are lost!!!I am:
- Join Date
- Sep 2012
- Posts
- 1,704
- MTV$
- 5,031
Re: CSS to the Rescue
You now have an image in the background of the h1 that is only repeated horizontally, and a border around it, separated from the text by at least five pixels. You've also removed the margin (blank space) from the bottom of the element. These are feats that HTML can't even come close to matchingand that's just a taste of what CSS.owo this is really a cool information on html . This is really a meaning ful thing and makes alots of sense being here in this forum . Thank you friend for posting such great task here ....
-
09-14-2012, 01:09 AM #5
Banned
This user has no status.I am:----
- Join Date
- Sep 2012
- Posts
- 1,129
- MTV$
- 3,336
Re: CSS to the Rescue
In the first place, CSS allows for much richer document appearances than HTML ever allowed, even at the height of its presentational fervor. CSS lets you set colors on text and in the background of any element; permits the creation of borders around any element, as well as the increase or decrease of the space around them; lets you change the way text is capitalized, decorated (e.g., underlining), spaced, and even whether it is displayed at all; and allows you to accomplish many other effects.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)































Reply With Quote



Bookmarks