An Introduction To CSS
CSS is the abbreviation for Cascading Style Sheet. A style sheet simply holds a collection of rules that we define to enable us to manipulate our web pages.
CSS can be applied to our pages in many ways, however the most powerful way to employ CSS rules is from an external cascading style sheet. When used in this manner the full power of CSS can be brought to control the design and appearance of our work from a single controlling location, which makes it easy to update our site on a global basis.
It would be foolish, impracticable and probably impossible to write an article that covers all aspects of CSS. What I would like to do is take you on a journey, a journey that will begin with the simple things. We will look at how CSS rules are structured and how we can optimize our style sheets by using shorthand within our rules. We'll investigate many aspects of CSS throughout our journey. I hope you stick along for the ride.
Creating Cascading Style Sheets
Does that sound complicated? Well if it does, nothing could be further from the truth. A css file is merely a text file with a .css extension, it's as simple as that! We can create the file in DreamweaverMX or in something as simple as Notepad, it really doesn't matter.
There are dedicated CSS editors out there. My favourite CSS tool is TopStyle which, unfortunately, is only available for the Windows platform. It is a first rate CSS editor and I highly recommend it. If you're working on a Mac, take a look at http://www.westciv.com/style_master/, I have not used it but it should be worth a look as a TopStyle alternative. To be fair to DreamweaverMX, its CSS panel is greatly enhanced over previous versions but Dreamweaver is not a dedicated CSS editor, it just does CSS editing as well.
For the purpose of this section we'll create our .css file using Notepad rather than DreamweaverMX. I'm taking this route because Dreamweaver tends to hide things behind its CSS Panel and I want you to see the CSS rules as they are written.
I also want to teach you how to write your own rules and the declarations that they hold, this will help you to learn the syntax of CSS. If you understand the syntax it's easy to make corrections to your styles when needed. If you are working along and using a Mac, SimpleText is available on OS9 and TextEdit will be your choice on OSX.
References:
CSS:An Introduction [Online], Retrieved 16 March 2011.
URL:
http://www.communitymx.com/content/article.cfm?cid=b6a50
No comments:
Post a Comment