7

ヘッダー内にアンカー タグがあり、アンカー タグに border-bottom を配置しようとしていますが、これは機能しますが、下部のパディングが大きすぎて負のパディングが機能しません。これを回避するにはどうすればよいですか?

ライブサイト

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; }
4

2 に答える 2

11
#featureText a {
    line-height: 1em;
    display: inline-block;
    color: #414042;
    text-decoration: none;
    border-bottom: solid 2px #414042;
    padding: 0;
}
于 2012-11-24T23:56:38.667 に答える
5

私はお勧めします:

#featureText h1 a {
    /* all your other CSS... */
    display: inline-block;
    line-height: 1em;
}
于 2012-11-24T23:57:25.170 に答える