Grow your CSS skills. Land your dream job.

padding on the text. Bad?

  • # October 7, 2009 at 8:33 pm

    I was wondering if it was bad css if i was to put padding on a text link.
    I want to have the text link to have a border.
    Is this bad or ok.

    Code:
    p a {
    background: #99ccff;
    color: #333;
    padding: 0px 5px 0px 5px;
    border: none;
    text-decoration: none;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    }
    # October 8, 2009 at 2:09 am

    I suppose you can do whatever you want, but I wouldn’t recommend it. You really don’t want to make a user have to think about what they’re doing. An underlined word is a link, this is an assumption that the user will always be able to make. Changing that could cause frustration.

    At the end of the day, it’s your design, and you can do whatever you’d like to. Just keep the end user in mind!

    Rob
    # October 8, 2009 at 5:47 am

    as Doc said – its not bad CSS to use padding on anything. What I would say is its bad CSS to use padding to position something, but padding is a very useful option :) Your design…

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".