SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: css links?

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2002
    Location
    BOSTON
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking css links?

    hey there!
    hope everybody is enjoying a wonderful friday with a pint of pilsner!
    anyways...
    here is the deal, i am by no means an expert on css, but i can and have done many things...
    and i was wondering what is the best way to style my page in such a way that:
    1. text links can have an underline
    2. img links do not have the underline

    i figure i could just take off the defualt underline and then make a span or layer just for the text links...
    any thoughts?
    cheers
    PEACE

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do you mean image links have no underline? If you use an image as a link (which is what I think you mean) then the link will not be underlined.

    You can use classes to do this. Just try something like:

    Code:
    a.textlink {
    blah blah
    }
    
    a.imagelink {
    text-decoration: none;
    }
    The the image links would get class=imagelink in the <a>-tag, and the textlinks would get class=textlink in the <a>-tag.

    I hope this helps .

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2002
    Location
    BOSTON
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    yep

    thanks for the reply,
    with so many possible attributes, getting the style the best and most efficient way is always an interesting journey

    i like your idea better, so far i had the img border set to zero with all of the anchor text-decorations at none

    i'll probably have more thoughts later
    thanks again!
    PEACE

  4. #4
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would like to add one thing, the text-decoration attribute does not apply for the borders of the image if I am correct, so you will have to get rid of those manually, or by using:
    Code:
    img.imagelink {
    border = 0px;
    }
    Which basically means another class, but less typing .


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
  •