Web Development Tutorials and Resources for Web Developers
from Beginners to Professionals
Introduction to CSS/Cascading Style Sheets
What is CSS?
CSS (cascading style sheets or style sheets) allows you to specify the style and layout of many web pages at once by making changes to a single style sheet.
Style sheets are files with instructions on how to present a web page(s) in a web browser such as Firefox or Internet Explorer. CSS instructions can be within the web page itself, or in a separate document which is linked to the web page.
CSS allows you to specify properties on one of your web pages. This allows you to make changes to many web pages at once.
Before you learn CSS
Before you learn CSS, you should have at least a basic understanding of HTML/XHTML.
Benefits of CSS
- Your web pages load faster because there is less code to transfer
- There is less code to type
- It is easier to have a consistent look and feel to your entire web site
- Updating and maintaining websites is much easier and less time consuming
CSS also allows you to:
- position text and graphics precisely where you want to
- add rollover effects to links
- control the spacing between letters, lines, margins, web page borders
- specify the units such as centimeters, pixels, points and more
- hide content from certain web browsers in certain situations. An example of this is when you have some content that you want to appear only in your web pages, but not in print.
Web Browser Compatibility
You should know that different web browsers interpret CSS standards in different ways and will want to see how your website looks in at least the most popular browsers. Some older browsers are not able read CSS at all, although this is very rare now and steps can be taken to handle these situations. You will also want to see how your website looks in different screen sizes.