Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > HTML > BOOK: Beginning HTML, XHTML, CSS, and JavaScript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning HTML, XHTML, CSS, and JavaScript
This is the forum to discuss the Wrox book Beginning HTML, XHTML, CSS, and JavaScript by Jon Duckett; ISBN: 978-0-470-54070-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning HTML, XHTML, CSS, and JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 17th, 2011, 02:54 PM
Registered User
 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default text-decoration in visited and hover not working

Hi-
I am working on example 1 in chapter 8, and I notice that my text-decoration property is not working in css visited or active pseudo-classes of links. The color property works fine, but the visited (a:visited) text-decoration seems to take whatever the link (a:link) text-decoration is and the active (a:active) seems to take whatever the hover (a:link:hover) text-decoration is. Any help is much appreciated. Thank you.

here is my code:
Code:
/* style sheet demonstrating styles of links */

body {background-color:#ffffff;}

a {
  font-family: arial, verdana, sans-serif; 
  font-size:12px;
  font-weight:bold;}

a:link {
  color:#0000ff;
  text-decoration:line-through;}

a:visited {
  color:#333399;
  text-decoration:none;}

a:active {
  color:#008000;
  text-decoration:none;}

a:link:hover {
  background-color:#e9e9e9;
  text-decoration:underline;}

Last edited by liucc; July 17th, 2011 at 03:00 PM..
Reply With Quote
  #2 (permalink)  
Old September 4th, 2011, 03:26 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First of all a:link:hover should be a:hover and second you should always place a:active below it's considered good practice and it could cause rendering problems. Hope this solves your problem
Reply With Quote
  #3 (permalink)  
Old September 11th, 2011, 02:14 PM
Registered User
Points: 87, Level: 1
Points: 87, Level: 1 Points: 87, Level: 1 Points: 87, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2011
Posts: 13
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You must to define the anchor pseudo-classes in this order:-

a:link
a:visited
a:hover
a:active

Each one of these pseudo-classes defines itself and the ones that come after it in the list. Because you have hover after active, both will appear the same, i.e. way that [I]hover[I] is defined.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'Exception' is not counting the no. of times the mouse hover on the text. arbab BOOK: Beginning JavaScript and CSS Development with jQuery 2 May 31st, 2011 02:18 AM
Chapter 3 - a:visited not working VeganMan BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 April 3rd, 2008 12:31 AM
IE6: Hover stops working on AJAX page sigilaea Ajax 0 March 17th, 2008 09:58 AM
Hover/Text Decoration Weirdness interrupt CSS Cascading Style Sheets 2 August 8th, 2005 09:11 AM
Problem with text-decoration in cascaded <li> setesteve CSS Cascading Style Sheets 6 January 7th, 2005 10:53 AM



All times are GMT -4. The time now is 01:45 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.