simple css problem

Posted on 2004-11-27
Last Modified: 2012-05-05
This is a simple css class that I wish to apply on text, now the problem is that the text contains Links too and I want to change link color, font etc.
.quote {
      font-family: Verdana;
      font-size: 9pt;
      font-style: normal;
      line-height: normal;
      font-weight: normal;
      font-variant: normal;
      text-transform: none;
      color: #000000;
.quote:link {
color:#3333ff; text-decoration:none;font-size: 11pt;
.quote:visited {
color:#66666; text-decoration:none;
.quote:active {
color:#FF0033; text-decoration:underline;
.quote:hover {
color:#3333ff; text-decoration:underline;
The class is working well for simple text but when links come it doesn't apply the code for this(like for hover, visited and link).
Question by:jimmy282
    LVL 31

    Expert Comment

    Like this:

    .quote a:visited { color:#66666; text-decoration:none; }


    <p class="quote"><a href="#">text</a></p>

    Let me know if you need more detail, okay?

    LVL 49

    Expert Comment

    In the current setup you could try using:
    <p class="quote">text <a href="#" class="quote">link</a> text</p>

    But the solution provided by seanpowell has some better semantics.

    LVL 11

    Author Comment

    my problem is this.
    I already have text in about 200 pages/
    something like this.
    <A class="" href="something.htm"><SPAN
    class=quote>text here</SPAN></A>

    now how do I apply my "quote" class to these SPAN's inside the <a> tag. please help.
    LVL 11

    Author Comment

    I dont want to change the HTML at all. I can only make changes to the css. but what changes?
    LVL 49

    Accepted Solution

    a:link span.quote {some definitions}
    a:visited span.quote {some definitions}
    a:active span.quote {some definitions}
    a:hover span.quote {some definitions}

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Title # Comments Views Activity
    Bootstrap Accordian 9 97
    Bootstrap - CSS 1 40
    Basic CSS issues 24 26
    CSS/audio questions 2 41
    Most web designers often experience crossbrowser issues during interface design / development.  On common problem is with Internet Explorer due to its rendering discrepancies between previous versions.  Here are some techniques I use to help avoid c…
    "I want to put my photos online, but I don't want them stolen.  What settings should I use?" When You Put Photos Online First and foremost, any digital file published on the WWW can be copied, stored, modified, retransmitted, etc.  Remember Naps…
    In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now