Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Reverting to standard style after change.
Old 03-02-2006, 04:36 PM Reverting to standard style after change.
Novice Talker

Posts: 11
Trades: 0
A portion of my page needs a modified style like the following:

<style>
A:visited {text-decoration: none; color: navy; padding-right: 40px; background: url(images/visto.gif) no-repeat 100% 60%; }
</style>

which works OK.

Now: the rest of the pages should go back to the standard style:

<style>
A:visited {text-decoration: none; color: navy;}
</style>

Putting this at the end of the modifies page does not work.
How should I do it?
Thanks very much for helping.
ContiW
contiw is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-02-2006, 05:27 PM Re: Reverting to standard style after change.
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
add a class to the links that need the change like <a class="myclass">

and then your style could be:

a.myclass:visited

That way only links you add that class to will get those styles and all other links will get the original style.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 03-02-2006, 06:17 PM Re: Reverting to standard style after change.
Novice Talker

Posts: 11
Trades: 0
<style>
A.visto:visited {text-decoration: none; color: navy; padding-right: 40px; background: url(images/visto_0.gif) no-repeat 100% 60%;}
</style>

Great. ThankYou very much. That works ok.
Now going a little step further:
I would like to change the background image of the class

I have tried:

<a class="visto" onMouseover="document.getElementById('visto').back ground='url(images/visto_1.gif)'" href=" ......

or

<a class="visto" onMouseover="this.class.background='url(images/visto_1.gif)'" href=" ......

but it doesn't quite works.

Please another little push.
contiw is offline
Reply With Quote
View Public Profile
 
Old 03-02-2006, 06:55 PM Re: Reverting to standard style after change.
angele803's Avatar
Perfectly Imperfect

Posts: 1,774
Name: Stephanie
Location: Oklahoma
Trades: 2
I think you need to use a:hover for this. You could do a.visto:hover {attributes}.
I think that will work.
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 03-02-2006, 07:15 PM Re: Reverting to standard style after change.
Novice Talker

Posts: 11
Trades: 0
Impeccable angele803!
Thanks for your help.
WalterConti
contiw is offline
Reply With Quote
View Public Profile
 
Old 03-02-2006, 07:18 PM Re: Reverting to standard style after change.
Novice Talker

Posts: 11
Trades: 0
No, Wait! That applies to "all", not only those "visited".
contiw is offline
Reply With Quote
View Public Profile
 
Old 03-02-2006, 07:24 PM Re: Reverting to standard style after change.
angele803's Avatar
Perfectly Imperfect

Posts: 1,774
Name: Stephanie
Location: Oklahoma
Trades: 2
So, you want a different background to show up when the user rolls over the link, but only when that link has already been visited?

If so, try:
a.visto:visited:hover {attributes}
__________________

Please login or register to view this content. Registration is FREE

Last edited by angele803; 03-02-2006 at 07:33 PM..
angele803 is offline
Reply With Quote
View Public Profile
 
Old 03-02-2006, 07:32 PM Re: Reverting to standard style after change.
Novice Talker

Posts: 11
Trades: 0
Yes.
I have tried

A.visto:visited {text-decoration: none; color: navy; padding-right: 40px; background: url(images/visto_0.gif) no-repeat 100% 60%;}

A.visto:visited:hover {text-decoration: none; color: navy; padding-right: 40px; background: url(images/visto_1.gif) no-repeat 100% 60%;}

but I still fishing in the dark with CSS.
contiw is offline
Reply With Quote
View Public Profile
 
Old 03-02-2006, 08:01 PM Re: Reverting to standard style after change.
Novice Talker

Posts: 11
Trades: 0
I have found a way of doing it:

Created another class with a different background image:

A.vistohover:visited {text-decoration: none; color: navy; padding-right: 40px; background: url(images/visto.gif) no-repeat 100% 60%;}

then

<a class="visto"
onMouseover="this.className='vistohover'" onMouseout="this.className='visto'"
href="... "></a>

Works good.

Thank you angele for "leading me to the water"!
WalterC
contiw is offline
Reply With Quote
View Public Profile
 
Old 03-02-2006, 09:20 PM Re: Reverting to standard style after change.
angele803's Avatar
Perfectly Imperfect

Posts: 1,774
Name: Stephanie
Location: Oklahoma
Trades: 2
I am glad you figured it out! Thanks also for posting how you did it. I was stumped and it is good to see a slution!
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 03-03-2006, 02:12 AM Re: Reverting to standard style after change.
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
contiw, that's part of the beauty of classes. You apply a class to any element you want to behave in a certain way and then apply the styles to that class in the css. Only those elements that have the class apllied to it should display the way you set.

Glad you got it all working.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to Reverting to standard style after change.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.42223 seconds with 12 queries