CSS And The End Of Tables

In the past, tables were the only way to create even the slightly complex layouts. Due to this reason, some of the Internet sites used an excessive number of tables one inside another. However, CSS has put an end to this.

Disadvantages of Tables
Tables make the HTML a mess of webbed rows and columns. There is no clear distinction between its different parts. To redesign your site, it is required to extract the entire content from the tables and rebuild the tables from the scratch.

What's CSS?
Cascading Style Sheets, or CSS is used to apply styling information to your web pages. It can be identified by the tag name, or by IDs and specified classes.

CSS Selectors
CSS is dependent on the tags that have classes and IDs. IDs refer to a single tag, whereas class can refer to more than one. When you use the tag's name, the CSS rule will affect all those tags. However, if you use the name of the tag followed by a dot and the class' name, it will affect the tags with that class only. The tag's name followed by a hash and the ID name will affect the particular tag with that ID.

Thus,

p - all paragraphs
p.thing - all paragraphs in the 'thing' class
p#thing - the paragraph with the ID 'thing'

Useful CSS Rules
Some of the commonly used CSS rules are:

* background-color. It is used to set a page's background color with the use of HTML colors.

* color. It is used to set text colors.

* font-family. It is used to set fonts to the text.

* font-size. It is used to set the font size in px or em.

* margin. It is used to specify the amount of space around the edges of some content. The -left, -right, -top and -bottom margins can be set individually.

* border. It is used to put a border around the boxes. There can be three types of settings for this, i.e., the width, type and color.

* text-align. It is used to align text on the left, right, or center.

* text-decoration. It is used to control text effects such as stoppage of links from being underlined.

* float. It is used to instruct the content to float over other content and not stay behind it. It is used to stimulate table like effect.

Spread the word

del.icio.us Digg Furl Reddit Ask BlinkList blogmarks Blogg-Buzz Google Ma.gnolia Netscape ppnow Rojo Shadows Simpy Socializer Spurl StumbleUpon Tailrank Technorati Windows Live Wists Yahoo!

Print

Related Entries

Related Tags

, , , ,