A look into CSS

8. March 2010 14:07

A look into CSS

 

As anyone who has coded any html pages can tell you, formatting the layout and appearance of the text and images is a time consuming task. This becomes especially apparent if you have to write formatting code for each element and each individual web page. Often times you will be writing the same formatting code for each page. This can very quickly become a tedious task. To eliminate this headache, the World Wide Web Consortium created Cascading Style Sheets (CSS).

With CSS one can setup the colors, fonts, alignment, and so on for many html attributes. As opposed to nesting a countless number of styling tags, you can simply insert all of the formatting tags into one section of code or a separate file. When you use that particular HTML element, the browser will know to apply the defined formatting to the element. span>

The most common example we see used is that of the paragraph tag. Much like writing JavaScript, CSS code is written in between its own tags. Normally I'd used the P for the paragraph tag, but doing so would change the color of the whole blog. So for this purpose I am assigning a color attribute to an id selector.

 

For example:

<html>

<head>

<style type= “text/css”>

#p1

{

 color:green;

}

</style>

</head>

<body>

<p id=p1> The line is green. </p>

</body>

</html>

The line is green. I used an id for the paragraph to keep the whole page from turning green.





Comments

4/28/2010 1:02:02 AM #

Rapidshare

I\'m happy I found this blog, I couldnt discover any info on this subject matter prior to. I also run a site and if you want to ever serious in a little bit of guest writing for me if possible feel free to let me know, i\'m always look for people to check out my site. Please stop by and leave a comment sometime!

Rapidshare United States |

5/8/2010 6:50:16 PM #

Mariana

Thanks for the info. Regards.

Mariana United States |

5/20/2010 1:59:18 AM #

Wahdo News

Thanks for the info. Regards.

Wahdo News United States |

6/18/2010 11:15:03 PM #

няня

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now.
http://svitlana.net.ua/staff/category/3/ гувернантка, http://svitlana.net.ua/staff/category/5/ повар, http://svitlana.net.ua/staff/category/6/ садовник, http://svitlana.net.ua/staff/category/10/ репетитор, http://svitlana.net.ua/staff/category/4 домработница, http://svitlana.net.ua/staff/category/8/ семейная пара, http://svitlana.net.ua/pages/2/ работа няней.

няня United States |

Comments are closed


About the author

 The creators of the Web Design Blog have been creating web designs for over 12 years

Page List