CSS <button> Reset: Vertical Label Position? -
i want reset button
's inherited css behaves other inline-block element. however, i've run problem text of button forever stuck vertically-centered.
in fiddle (and screenshot) below, button
, div
have exact same styles according chrome developer console, yet button's text vertically-centered, while div's not:
http://jsfiddle.net/rgthree/vt3a7/
anyone know of property or selector reset button, including label position?
answer
there's no way in browser other chrome ~25. reached out chromium project not working in chrome 27 (see @winterblood answer & comments). said this:
the issue use margin:auto on anonymous block inside button centering inside button in order safe-centering. so, unfortunately, there's no way style css. able control behavior before implementation detail leaking out.
so, true answer cannot style in browser, except chrome ~25 -webkit-box-align
inadvertently exposed to, @winterblood answered.
for webkit need override -webkit-box-align
value of baseline
or start
.
i have had no luck implementing in firefox yet (from brief @ it).
Comments
Post a Comment