Home
Username:
Password:
CSS 2/3 Tutorials

CSS Fundamentals / Good Practices

Subtitles of the Movie

This movie seeks to provide you with some good general practices and ideas to incorporate in your use of CSS. Now feel free to experiment and find out what works best for you. The following are just suggestions that have worked well for me and other people. So, first of all, avoid Inline Styles. Using Inline Styles makes it difficult to update the appearance and places the style information inside your HTML, so thus you end up having your appearance intermingling with your structure, which is kind of a bad thing. Also, try to limit embedded styles. Limiting embedded styles is not the same as limiting the use of Embedded Style Sheets. Limiting embedded styles is so that you don't have too many styles inside of your Styles section on a given page. If you find that multiple pages use the same styles, consider making it a shared style in a linked document. Another thing about too many embedded styles is that too many styles in an embedded sheet might indicate that the page may be straying too far from the overall design of the entire web site, so if you find that to be the issue you may need to reconsider what you're doing with that particular page. Next, you want to avoid adding too many Div tags, classes, and ID's. In general, this is talking about using the structure that is available to you by the HTML without having to add in too much additional markup. Next, make sure that you're leveraging modularity. Modularity makes it easier for you to change things later on, so you can separate CSS rules into different categories and place them into different CSS files, and use the Import tag and Link to pull the appropriate CSS files as you need. Of course, I recommend that you get pretty familiar with CSS in general before you start going into this modularity concept. Also, liberally use your Comments. As previously mentioned, it's going to help you locate things a lot easier. In large files you can search for the section that you have set up, so if you just pull up the Find feature and type in the section you want to go to, it's going to jump you to that section very quickly. Lastly, consider minimizing large CSS files before publishing them. If you do a search on the Internet for a CSS Minimizer, CSS Compressor, you're probably going to find a number of different things that pop up and what they essentially do is they remove extra white space and sometimes they'll also get rid of carriage returns, or where you hit the Enter key. Now these Minimizers are very handy for extremely large CSS files because a lot of that extra white space will contribute to a larger file size. If you do decide to minimize, I recommend that you maintain a develomental copy so that you'll be able to actually read what's inside of there. All of these items are to be considered general good practices and they will enhance your writing and maintenance of CSS, but they should in no way be considered part of the CSS specification. You are free to take as little or as much of this as you wish in your practices. And with that in mind, that concludes this movie and it also concludes this Section on CSS Fundamentals. At this point you should know quite a bit about how CSS works in conjunction with your HTML documents.

Tutorial Information

Course: CSS 2/3
Author: James Street
SKU: 34028
ISBN: 1-935320-64-5
Release Date: 2009-08-28
Duration: 13.5 hrs / 147 lessons
Work Files: Yes
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available