Developing a CSS Strategy

by Maneet Puri.

Share
|
Homepage | Submit your article | Contact | TOS
More articles on web design and development  

You are here: Categories » Internet » Web design and development

When CSS Gets Messed-up

One of the great benefits of CSS is that it substantially reduces the repetitious formatting code out of the HTML mark up and consolidate the same in the CSS which saves the programmers a great deal of time and effort. The styles can be reused to build multiple text blocks and control layout and formatting on multiple pages. The best part is that it considerably saves a lot of development time having all the reusable formatting in a centralized location, especially when you edit or update your website.

On the flip-side, CSS can get all messed-up as you keep on adding more styles to the style sheet. There are different styles to redefine HTML tag attributes, class and id selectors to format different text blocks, and also different styles for page layout. Again, while some of these styles are site wide, others are applicable to individual pages. Further, there are cross-browser compatibility issues and so forth. With all these stuffs going into the style sheet, often things become confusing unless you have developed a proper CSS strategy.

Devising Your CSS Strategy

Organize You CSS Styles – The most common blunder quite a few web developers commit is that they put all the styles for the entire site into one CSS file. Although this approach works for a small site with a very few pages having specific styles, for the bigger sites it is better use multiple CSS files.

The key is to divide the style sheet file into different sections. For instance, in the main style sheet especially in the first section should contain the styles with the broadest site wide application, so it's mostly populated with styles that redefine the properties of HTML tags. The other section can contain styles to format common page elements, such as the navigation bar or footer. The styles that control site wide page layout can be placed in another section. Subsequent sections should create groupings of styles with a progressively more specific focus.

Avoid "class-itus" – many web developers tend to overuse classes and IDs. Though it is one of the basics of CSS to add classes and IDs to the markup and define CSS styles to format page elements, some developer however, get in the mindset of creating a class for every little thing that needs formatting. Instead, it is much wiser to redefine the properties of HTML tags than creating a different class.

Design for the best browser – Because of the its comprehensive use, most web coders tend to keep Internet Explorer browser in their mind while designing a web page. Later on, they make necessary adjustments in the style sheet to comply with other web browsers. Though, this looks pretty logical an approach. However, they by doing this they tend to write codes which contain all the idiosyncratic features of IE in the style sheet. As a result, it actually takes them a substantial time to make necessary adjustments in the codes for other browsers. Hence, they literally rework for a substantial portion of the code in the process.

If as a web developer, you want to produce standard-compliant code, then previewing Mozilla's Firefox instead of Internet Explorer would be much more helpful to you. First of all, Mozilla’s Firefox is the most standard-compliant browsers available at the moment. Secondly, it has the web developer tool bar extension on it which will help you a great deal. After you code for Mozilla’s Firefox, you can test it for the other browsers and add hacks and code tweaks to fix compatibility issues.

Author Box

Maneet Puri heads Day Robinson Services, a major IT solutions provider offering outsource website maintenance India services. For over last 10 years, Maneet has been assisting many offshore clients in implementing web-based applications for their websites. His company also delivers web development India and web design India services. Maneet offers exeperts advice on other web-based applications to his overseas clients.

Maneet Puri spearheads Day Robinson Services India, a well-known name in the field of web based application services, web optimization services, and web development India services. Having over 10 years of industry experience, he has implemented web design India services for many of his international clients. He also offers expert advice on web-based application services, search engine optimization and various knowledge driven processes to his clients based overseas.

Leave a comment or ask a question
Total comments: 0

Web design and development Disclaimer

  • The e-articles directory is not responsible for any and all copyright infringements by writers and authors. If you suspect the information contained by this page for any copyright infringements, please contact us to investigate the issue
Journey of the Internet - A decade ago who could have thought that we could watch a live event being held just about anywhere in this world straight on our desktop machine or watch movies online on our laptop as if it was p (more...)
The Essential Ingredients Of A Magnetic Website - Yes, believe it or not, there is actually a recipe for creating a website that is magnetic. A website that attracts targeted people far and wide like a super-powerful yet pinpoint-accurate magne (more...)
What it takes to build a website - It takes many skills to build a website. In this article we discuss some of those skills and the importance of them. Many people think that building a website consists of one skill when in (more...)
XHTML in web design - Brief description Network is changing. In fact, the networks are changing every day: different languages, algorithms, concepts and thinking. As you have just fin (more...)
The Top 4 Benefits of a Content Management System - One of these tools is called a "content management system," or CMS for short, and I want to spend just a little bit of time telling you what I consider to be the top four benefits of using a CMS to (more...)
What is a Content Management System - A content management system (CMS) is a system used to manage the content of a Web site. In brief, we can say content management system for the formation, alteration, archiving and exclusion (more...)
Importance of Attractive Website Footer - Attractive website footer can increase attention of your website as well as help to increase your online leads or online sales. These days many add-ons customized website footer available on the In (more...)
Building Shopping Cart Applications - The heart of any Web store is the software that it runs on. However, up until relatively recently, software solutions for e-commerce were largely do-it-yourself affairs, consisting of a number (more...)
Tips for Web Design and Development - In the Today's tough competition every business need create their brand value and promote their company on internet. For this a business need a website where they will list their all the services (more...)
E Commerce Application Security Technology Essentials - In today’s marketplace, across all industry segments, businesses are realizing that transformation to e-business is required to remain competitive. Analysts predict that companies not mak (more...)

 
free content
    Copyright © 2006 - 2012 e-articles.info.
The texts, articles and tutorials in the directory are property of their respective owners and authors.