Well, I created a class called .btn
, where I wanted to use it for both button
and a
. So I forced some things in this class to reset the original style of both button
and a
.
For example, in a
I removed text-decoration
. In button
, I forced the change from background
to border
. So far so good.
The problem is that I'm noticing that the button
element, even using -webkit-appearence: none
, behaves differently in relation to the alignment of the internal text, as tested below:
.btn{
border: 1px solid transparent;
padding: 10px 20px;
box-shadow: 0 1px 2px 0px #666;
outline: none;
border-radius: 4px;
background-color: #efefef;
cursor: pointer;
transition: box-shadow .1s ease-out, border-color .3s linear;
font-weight: bold;
box-sizing: border-box;
vertical-align: top;
display: inline-block;
min-height: 55px;
font-size: 14px;
text-decoration: none;
color: #222;
background-image: none;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
font-family: Arial;
}
<button class="btn">
Eu sou um <Button>
</button>
<a class="btn">
Eu sou um <A>
</a>
I'm going to put the image too, to show how the rendering in my Google Chrome was:
Now,myquestionis:
Whatpropertycauses
button
toaligntextinthemiddle,whilea
doesnot?Isthereawaytoresetthisdefaultalignmentof
button
?Myintentionwastomakethetwocentralized,butmoreimportantly,Iwanttoknowifthereisapropertyofbutton
madealignedtothecenter.
Note:Thequestionisnotjusttoknowhowtoalignthetexttothecenter,buttoknowindepthaboutwhatcausedthedifferencementionedabove,sinceIusedthesamestyleforeveryone.
Note2:Icoulduseinline-flex
andmatchjustify-content:center;align-itens:center
,butthat'snottheanswerIwant,sinceI'malreadyputtingitinthequestion.Iwanttoknowspecificallyaboutthedetailspresentedabove,notjusta"support for the alignment problem"