Style Sheets
  Home arrow Style Sheets arrow Page 4 - Learn CSS: Pseudo Classes
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 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

Learn CSS: Pseudo Classes
By: Michael Youssef
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 20
    2005-07-11

    Table of Contents:
  • Learn CSS: Pseudo Classes
  • The :link and :visited Pseudo Classes
  • The :hover Pseudo Class
  • The :active Pseudo Class
  • The :focus Pseudo Class

  • 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


    Learn CSS: Pseudo Classes - The :active Pseudo Class


    (Page 4 of 5 )

    The :active pseudo class applies the styling rules while the user is clicking on the element. It's supported by  IE 5.5 and 6, Mozilla 1.7 and Opera 7.5. As with the :hover pseudo class, the :active class applies only to hyperlinks with IE, but in Mozilla it can be applied to any element. For this example, I will add a <p> element to the HTML code and two more CSS rules to the CSS code, which apply the hexadecimal background color #F6D5D5 and the text color #CC00CC to the active hyperlinks and the active paragraphs in the document. In the first following browser window the user is clicking on the first link; in the second window the user is clicking the paragraph. Add the following <p> element just before the closing tag of the <body> element:

    <p>This is a paragraph text</p>

    And add the following two CSS Rules to the CSS code file:

    a:active
    {
      background-color: #F6D5D5;
      color: #CC00CC;
    }
    p:active
    {
      background-color: #F6D5D5;
      color: #CC00CC;
    }

    More Style Sheets Articles
    More By Michael Youssef


     

    STYLE SHEETS ARTICLES

    - Image Replacement CSS Techniques
    - Using BlueTrip`s Success, Notice and Error C...
    - More Uses for the Thin and Caps CSS Classes ...
    - Styling Definition Lists with the BlueTrip C...
    - Styling Unordered and Ordered HTML Lists wit...
    - Using the BlueTrip CSS Framework`s Thin and ...
    - Adding Borders to Web Page Columns with Blue...
    - Introducing the BlueTrip CSS Framework
    - Using a Background Grid to Assist Web Page L...
    - Extending the Rule Of Thirds for Web Page La...
    - A Two-Column Web Page Layout Based on the Ru...
    - Using the Rule Of Thirds for Web Page Layout
    - Swapping Columns Using the Divine Ratio for ...
    - Using the Golden Ratio in Liquid Web Page De...
    - Fundamental Design Principles for Web Page L...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek