Tips for Optimizing CSS

1. Replace inline style with type selectors to target multiple instances of identical
elements.
2. Use descendant selectors to avoid inline classes.
3. Group selectors with common declarations.
4. Group declarations with common selectors.
5. Combine common styles into shared classes.
6. Use inheritance to eliminate duplicate declarations.
7. Use CSS shorthand to abbreviate rules and colors.
8. Abbreviate long class and ID names.
9. Use CSS2 and CSS3.x techniques.
10. Replace JavaScript behavior with CSS techniques.
In addition, you can eliminate extraneous whitespace by removing tabs, comments,
and returns.


Web pages that use inline style pepper HTML code with unnecessary font and style
tags. This effectively hardcodes the presentation directly within the HTML. Unless
the style is used only once, it is more efficient to create a CSS rule and target all elements
of a certain kind with type selectors (i.e., p, ul, h2, etc.). For example, this:




<h2 style="font-size:1.2em;color:red;">Little red Corvette</h2>
<h2 style="font-size:1.2em;color:red;">Baby you're much too fast to embed</h2>
<h2 style="font-size:1.2em;color:red;">Little red Corvette</h2>
<h2 style="font-size:1.2em;color:red;">You need a love that's gonna last</h2>
becomes this, by abstracting the inline style to a block style:
<style type="text/css"><!--
#main h2{font-size:1.2em;color:red;}
--></style>
The corresponding HTML cleans up to this:
<div id="main">
<h2>Little red Corvette</h2>
<h2>Baby you're much too fast</h2>
<h2>Little red Corvette</h2>
<h2>You need a love that's gonna last</h2>
</div>
 

Note how clean the code becomes after you remove the inline styles. This CSS technique
also helps search engine optimization (SEO) by boosting keyword density and
prominence.
Related Posts:
  • seo software Free SEO Tools with  Search Engine Optimization SoftwareFree resource offering link analysis and keyword research tools.http://tools.seobook.com Free Search Engine Optimization Software tools from SEO chatThe collecti… Read More
  • SEO Trend Spotting SEO Trend Spotting SEO trends move fast, so it’s OK to jump in where you are!  Use this primer to get clued in to some of the current jargon  and trends in SEO. Universal or blended searchRemember when the search… Read More
  • Keyword-Google’s exact tips Each page’s title bar.This area at the very top of the browser window is  believed to be indexed by Google: the search program doesn’t scan an entire Web page but only indicators such as the title that describe its su… Read More
  • Promote your website to your link prospects Create RSS feeds. Try registering with Feedburner Publish free newsletters.Recruit site visitors to your free benefit-packed  newsletter and you are building an emailing list. Use your newsletter to  promote your … Read More
  • Paid Search Ads No matter how blurred the line between unpaid and paid search  gets in the search engine results, you, as the SEO expert, will  always know the difference. That’s because,while it’s possible  to get listed … Read More
  • Search Engines Connotation Effective SEO Effective SEO requires a basic understanding of how the pieces  of search engine technology fit together. A search engine, such as Google, implements four basic  mechanisms: Discovery, meaning… Read More
  • How can article writing boost traffic The article on the free content site contains a link to your own website. Readers, after reading your articles, may choose to click on the link and pay you an unexpected visit. Having them on the free content sites is al… Read More
  • seo google panda Google pushed out their revised Panda Algorithm code-named  Panda 4.0. Panda is designed to remove low-quality content  from Google's search results. Google Panda is a change to Google's search results ranking … Read More
  • Web Analytics It might seem obvious, but starting correctly is critical. There are two important. facets of gettingstarted: first, you need to choose the right tool and you don’t even have to spend a lot, and second, you need to focus o… Read More
  • Increasing Your Mobility Connecting to the Internet in general, and to Google in particular, enlarges yourworld. That applies to the world of work, too. When your office is online, you don’thave to physically be on the premises to exchange messages,… Read More
  • AdWords as an SEO Tool As core SEO becomes simply one of the tools used to advertise destinations  on the Web, it makes sense to supplement pure SEO with targeted  CPCCost per Clickprograms, such as that provided by Google AdWords. … Read More
  • top online free seo tools  Link Tools .edu Backlink CheckerCheck for backlinks from .edu domains pointing to any website using the .edu Backlink Checker. This tool investigates pages from .edu domains indexed in search engines with b… Read More
  • Alexa Rankings Alexa Rankings attempt to rank all web sites globally  by quantity of traffic. The traffic rankings use statistics based on data gathered from the Alexa Toolbar and other tools connected to the service. The service is &… Read More
  • Keyword research- activities Picking the right combination of words is important. Search  engines have begun to payattention to page–copy word relationships. With that in mind, it is important to understand  the  topics  of  … Read More
  • How to Linking Articles? And another important thing to remember: if you are going to submit  articles to Ezines and/or contribute your articles to newsletters and other sites, DON’T ever forget to include a link to your site. A little resour… Read More