Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

border bottom padding on a anchor tag

I have a anchor tag inside a header and I am trying to put a border-bottom on the anchor tag, which works, however the padding at the bottom is too large and a negative padding wont work, how do I get around this?

live site

html

<div id="featureText">
        <h1>Recent Works / <a href="#">All</a></h1>
    </div>

css

#featureText a {
    color: #414042;
    text-decoration: none;
    border-bottom: solid 2px #414042;
    padding-bottom: -2px; }
like image 280
Cool Guy Yo Avatar asked Nov 24 '12 23:11

Cool Guy Yo


2 Answers

#featureText a {
    line-height: 1em;
    display: inline-block;
    color: #414042;
    text-decoration: none;
    border-bottom: solid 2px #414042;
    padding: 0;
}
like image 126
Luca Filosofi Avatar answered Oct 27 '22 01:10

Luca Filosofi


I'd suggest:

#featureText h1 a {
    /* all your other CSS... */
    display: inline-block;
    line-height: 1em;
}
like image 30
David Thomas Avatar answered Oct 26 '22 23:10

David Thomas