Reverting to default CSS after change.

Discussion in 'CSS' started by contiw, Mar 2, 2006.

  1. #1
    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%; }
    A:visited:hover {text-decoration: none; color: navy; background-image: url(images/visto_0.gif)}
    </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, Mar 2, 2006 IP
  2. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #2
    create CSS classes and assign those classes to the specific anchor tags you would like changed.
     
    ServerUnion, Mar 2, 2006 IP
    Mia likes this.
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    Did you make sure to refresh the page a few times. Css is cached so you normally have to refresh to see the changes. As far as code the code you posted should work depending on exactly what you want to do.

    If you post a url, it would be easier to see exactly what you are talking about.
     
    jestep, Mar 2, 2006 IP
  4. contiw

    contiw Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank you ServerUnion, Jestep. I have done the following:

    Created two classes with different background images:

    A.visto:visited {text-decoration: none; color: navy; padding-right: 40px; background: url(images/visto_0.gif) no-repeat 100% 60%;}
    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="...">#Title#</a>

    Works neat with "visited" links.
    Thanks for "leading me to the water"!
    WalterC
     
    contiw, Mar 2, 2006 IP
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    If you're going to post to two (or more?) forums at the same time, you've wasted at least one person's time. Not good e-manners.

    cheers,

    gary
     
    kk5st, Mar 2, 2006 IP