Reputation: 10396
I want to equalize the appearance of anchors, span and button within a certain context:
This starts of well, but as soon as a give an explicit width and height, <button>
behaves differently than all other tags. Am I missing a css property to equalize?
(the vertical-align
prop looked like a solution... as long as I had no explicit height...)
html
main>* {
font-size: inherit;
font-family: sans-serif;
color: inherit;
display: inline-block;
box-sizing: border-box;
text-align: left;
text-decoration: none;
border: none;
background: rgba(blue, .1);
padding: 0;
margin: 0 .1em;
width: 60px;
height: 100px;
overflow: hidden;
vertical-align: bottom
}
<main>
<button>button</button>
<a href='#'>anchor</a>
<a>plain</a>
<button>button</button>
<span>span</span>
<button>button</button>
</main>
Upvotes: 1
Views: 471
Reputation: 10396
Temani's Pointer to this elaborate analysis was a good one.
Well, there's a solution then, it seems:
height
, and put the desired height into line-height
insteadvertical-align: middle
(relevant for all tags except the button) overflow: hidden
width: 60px
vertical-align: middle // button won't care, but everyone else
line-height: 100px
I get, what I want (also the exact height btw, not plus some other base value)
Upvotes: 1