Why does <button>
always have its text vertically aligned but not.. Say, an anchor tag that is using the same styles?
Same styles meaning both have same display, padding, line height, text-align and vertical-align. But as soon as I change the tag from <button>
to <a>
, it breaks, text is no longer vertically-aligned
This is tough to figure out. I even went to check the webkit-core to find answers. I checked what does the <button>
element has and copied it out.
http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css
This guy says <button>
is styled differently but how?
Button's text vertical align
Can someone tell me how exactly is a <button>
is rendered by a browser?