How to remove default borders that come once you link?

Discussion in 'HTML & Website Design' started by friendlymentor, Jul 16, 2011.

  1. #1
    Well, I am creating a webpage first time my self. I know about divs, html ,css etc.


    I've created very simple web page with just the logo and some links.

    After I link the text to something, the text becomes blue and underlined, I dont want that to happen. Also, after I linked the logo image to the homepage, it got a border automatically.

    How do I undo these changes?
     
    friendlymentor, Jul 16, 2011 IP
  2. FoxIX

    FoxIX Well-Known Member

    Messages:
    211
    Likes Received:
    10
    Best Answers:
    1
    Trophy Points:
    140
    #2
    To stop the text and image from having an underline for the link, in your css file under the relevant divs, type:

    text-decoration: none;
    HTML:
     
    FoxIX, Jul 16, 2011 IP
  3. friendlymentor

    friendlymentor Peon

    Messages:
    177
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I did try that already.
     
    friendlymentor, Jul 16, 2011 IP
  4. 3dy.ro

    3dy.ro Member

    Messages:
    100
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    45
    #4
    Then you didn't try hard enough.

    Add this to your stylesheet:
    a {text-decoration: none;}
    Code (markup):
    If it doesn't work, it's probably conflicting with another CSS rule. Show us your CSS and we might help further.
     
    3dy.ro, Jul 16, 2011 IP
  5. friendlymentor

    friendlymentor Peon

    Messages:
    177
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5

    Thanks, that fixed the issue for the texts with underline and all..

    But the logo image still has the border. What shud i add for that?
     
    friendlymentor, Jul 16, 2011 IP
  6. cpmaster

    cpmaster Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    add to your stylesheet
    a img{border:0;}
    Code (markup):
     
    cpmaster, Jul 16, 2011 IP
  7. friendlymentor

    friendlymentor Peon

    Messages:
    177
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks a bunch, that worked.

    Thanks 3dy.ro and cpmaster.
     
    friendlymentor, Jul 16, 2011 IP
  8. jackburd

    jackburd Active Member

    Messages:
    396
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #8
    always use a CSS reset to avoid this problem on your future projects.

    I use my own CSS reset:

    *{
    margin:0;
    padding:0;
    }

    img, a img{
    border:0 none;
    }

    img{
    vertical-align:baseline;
    }

    a{
    outline:0;
    }

    input:focus, textarea:focus, select:focus{
    outline: none;
    }

    textarea {
    resize: none;
    }
     
    jackburd, Jul 19, 2011 IP
  9. patrick0001

    patrick0001 Member

    Messages:
    340
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #9
    Reset CSS only work, if a website does not contain any duplicate css. A site have multiple css file, it might overwrite each others.
     
    patrick0001, Jul 19, 2011 IP
  10. 3dy.ro

    3dy.ro Member

    Messages:
    100
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    45
    #10
    @jackburd
    Yes, I do too (however, some designers - for example John Snook prefer not to).

    But a CSS reset like YUI or Eric Meyer's doesn't get you rid of the color and underline of anchor links. Only the borders of images.

    @patrick0001
    And isn't this the idea of CSS resets? You load them first, and then you overwrite them with another stylesheet. CSS resets just give you a good, clean point to start styling your web pages.
     
    3dy.ro, Jul 20, 2011 IP
  11. patrick0001

    patrick0001 Member

    Messages:
    340
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #11
    I came across this situation when I working on a SharePoint project. Microsoft SharePoint itself have own CSS, if we load such resets CSS it will cause lot of problem. It requires me to spend time to check and override those CSS. Reset CSS is not recommend for certain CMS site.
     
    patrick0001, Jul 26, 2011 IP