Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS a:hover

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #33866
    aoeui
    Participant

    hi,

    what is your personal preference for styling links?

    a {color: #F90;}
    a:hover {border-bottom: 1px solid #F90;

    or

    a:hover {text-decoration: underline;
    #84767
    noahgelman
    Participant

    Depends. I’d always go underline if it was inline as not to potentially mess something up. But if the design called for it I’d use border and padding. Also, text-decoration, border, and outline can be combined for a very interesting effect

    #84771

    @noahgelman Border and padding don’t mess anything up at all as a link is inline by default. Here is an extreme example to illustrate my point: http://jsfiddle.net/sl1dr/xVaUQ/


    @krysak4ever
    In regards to your question, I have no default. It changes almost every project, depending on the project.

    #84773
    noahgelman
    Participant

    @sl1dr , but you can already see it messed up, the line goes all the way to the text below it, that’s what I meant. That combined with any number of inherited styles can make things look really goofy. Text-decoration isn’t really affected by anything else which is why it’s safer to use.

    #84774
    chrisburton
    Participant
    #84777

    @noahgelman @ChristopherBurton My example was ‘extreme’ to illustrate the point. Obviously you wouldn’t use that in anger.

    #84816
    chrisburton
    Participant

    @sl1dr: Your point was purely simple, I understood it quite well.

    I think @noahgelman is mentioning the difference in pixels between the two away from the text. However, I’m not sure how it may “mess something up” as it doesn’t break anything. Sure there is a difference in pixels away from the text but that’s probably the only argument. Also, you don’t notice as much when text-size becomes larger.

    #84819

    @ChristopherBurton That is why I did up the demo, to illustrate that nothing breaks, you just portrayed that much better than I did though! Thanks for the clarification.

    #84863
    noahgelman
    Participant

    Sorry, I suppose saying “mess something up” was a bit vague and sounded more of a bug creating issue.

    I meant it from a purely design standpoint. Can you do it? Sure. Does it break anything? No.

    But you’re less likely to get the desired affect if your goal is to underline the text (which I assumed was the goal since he compared border to text-decoration) since border’s purpose isn’t really made to underline text.

    Although border is much more flexible so if the design calls for it, go for it. I change the width, color or style of the underline when you use text-decoration.

    #84867

    @noahgelman The main reason I prefer using a border is that it doesn’t ‘cut through’ the text like using underline does. But it really isn’t that big of a deal either way.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘CSS’ is closed to new topics and replies.