Introduction To CSS
What Are Cascading Style Sheets
CSS has a simple syntax, and uses a number of English keywords to specify the names of various style properties.
A style sheet consists of a list of rules. Each rule consists of one or more comma-separated selectors and a declaration block.
declaration block...
A
?
a list of semicolon separated declarations in curly braces. Each declaration itself consists of a property, a colon (:) then a value.
In this tutorial, you will learn how much easier it is to create "layout rules" than it is to "nest" tables.
CSS is used by web designers to define colors, fonts, layout, and other aspects of website presentation. It is designed primarily to enable the separation of webpage content (written in HTML or a similar markup language) from webpage presentation (written in CSS).
This separation can
- improve content accessibility
- provide more flexibility and control in specifying layout and color
- reduce complexity and repetition in the content of webpages
- allow the same webpage to be presented in different styles for different media
- on-screen
- in print
- by voice (when read out by a speech-based browser or screen reader)
- on braille-based, tactile devices
- mobile devices, such as cellphones and ipods
- hold information for an entire website or collection of pages in one place
- reduce document code in size and complexity, since it does not need to contain any presentation markup
Why Use Cascading Style Sheets ?
Search Engine Rankings
Think of your desk drawer as compared to your webpage. If you have your papers all in that same drawer along with your paper-clips, pens, pencils and other office items, think how much harder it is to find a paper-clip, shuffling through piles of paper and stuff.
The same is true for search engine robots. If they can crawl through your page without having to read a bunch of code, before getting to the content, it takes much less time to read through your pages.
Some WYSIWYG Editors add a lot of unnecessary, bloated code. This can cause the Robots to either mis-read, or misinterpret the content on your webpage. With CSS, all the layout and tags are separated, so all they are reading is content, with no misinterpretations.
Time And Labor Savings
- you can change the color, size and placement of any of your main tags, in every line of code, on each and every page, all at once
- instead of poring over line after line of complicated "table" tags, you have changed every line of code in your whole website, by just changing one "declaration"
