SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Feb 2000
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm new to CSS and I was wondering how to do the following:

    I want the appearance of my links within my <p> tags to be different from those in the body. What's the selector to do this? I've tried p.a:link and other combinations but they don't work.

    Thanks,
    John

  2. #2
    SitePoint Member
    Join Date
    Jan 2000
    Location
    natick, ma, usa
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'm new to it too, but i *think* you'll need to define a class that has your atrributes in it.

    for example if i define:

    . plain { color: #0033CC; text-decoration: none; font-family: arial,helvetica,sans-serif; }

    then i would put <a class="plain"> </a> around my link and it would show up with no underline.

    is that what you're looking for?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2000
    Location
    WA
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you're close, but things need to be in a bit different order. Define your regular links something link this:

    A:link {color : #118811; text-decoration : none;}
    A:visited {color : #660000; text-decoration : none;}
    A:Hover {color : #0000AA; text-decoration : underline;}

    And then define your alternate links something like this:
    A.p:link {color : #444444; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;}
    A.p:visited {color : #ffffff; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;}
    A.p:hover {color : #0000AA; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration : underline;}

    Use your fonts, colors, and text decoration style obviously. Then in the anchor tag just add class="p" to each link you want to use the alternate link on and you'll be in business.

    ------------------
    Bimjo
    Bimjo's Corner

  4. #4
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A: Link, A: Visited, A: Hover are pseudo-class elements.

    nothingmanjb, your question was on how to set text apart from other text within the <p> tag. Here is suggestion:

    Body.normal {property:value; property:value;} then define your normal in the body tag <body class="normal"> this will set all text to your definition that falls in between <body></body>

    P.exception {property:value;} whenever you want to change a certain paragraph add the 'exception' selector to the <p> tag. <P class="exception">

    P.S. I just reread your question I hope this helps anyway
    ------------------
    IMHO,
    Westmich
    ***********************
    Your opportunity on the web is now!
    westmichiganweb.com

    [This message has been edited by westmich (edited August 16, 2000).]

  5. #5
    SitePoint Member
    Join Date
    Feb 2000
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys,
    I'll try a few of the ways you listed and see which one works best for me.

    John


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •