Style-Sheets
  Home arrow Style-Sheets arrow Page 2 - The Power of CSS
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
OLM
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE-SHEETS

The Power of CSS
By: Cliff Ritter
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 37
    2004-04-27

    Table of Contents:
  • The Power of CSS
  • Your CSS Code
  • CSS - Above and Beyond
  • Final Notes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Virtual Tradeshows by Ziff Davis Enterprise - A Unique Opportunity to Connect with IT Experts, Access Information, and Gain Insight on today's Technology

    The Power of CSS - Your CSS Code
    (Page 2 of 4 )

    In CSS you have the ability to create a background image on a particular style. Create your table with an individual cell for each link. In your CSS styles, you need to update the a:link and a:hover styles. For the a:link, make the graphic you have created to act as your button and/or the background image for that style. Then update the font attributes so the text will be visible on top of the background image. On the a:hover style, put the over state of the button as the background of that style and update the font attributes so you can see the text on the page. This is what your actual CSS code should look like for the a:link and a:hover styles:


    a:link{
     font
    -familyVerdanaArialHelveticasans-serif;
     font
    -stylenormal;
     font
    -variantnormal;
     text
    -decorationunderline;
     color
    #000000;
     font-weight: bold;
    width: 175px;
     height: 100px;
     background-image: url(images/home-button.gif);
     background-repeat: no-repeat;
     }
     
    a:hover{
     font
    -familyVerdanaArialHelveticasans-serif;
     font
    -stylenormal;
     font
    -variantnormal;
     text
    -decorationunderline;
     color
    #006699;
     font-weight: bold;
    width: 175px;
     height: 100px;
     background-image: url(images/home-button-over.gif);
     background-repeat: no-repeat;
     }

    This effect creates the perception of a rollover image. To site visitors, it will appear to be a regular rollover button created out of two graphics. The only difference is your cascading style sheet contains the images for both states of the link. This way when search engine spiders visit your website, they will only see clean html code -- without any images used for navigation -- and your keyword-rich text. As well, your web page should load much faster and be compatible with anyone still using an old dial-up connection.

    More Style-Sheets Articles
    More By Cliff Ritter


     

       

    STYLE-SHEETS ARTICLES

    - What is CSS?
    - The Power of CSS
    - Understanding Style Sheets (part 2)
    - Understanding Style Sheets (Part 1)




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway