Styling form elements is a well-known pain.
I would like to have the text of a given <button>
display in the bottom-right hand corner of that button.
Using flexbox with a <div>
this as straightforward as:
div {
display: flex;
justify-content: flex-end;
align-items: flex-end;
}
But with the <button>
it is rather less straightforward.
The really peculiar thing is that the <button>
does acknowledge justify-content: flex-end;
but not align-items: flex-end;
.
Example of align-items failing to override native styles of <button>
:
div {
background-color: rgb(191, 191, 191);
}
div, button {
display: flex;
float: left;
width: 130px;
height: 100px;
margin-right: 12px;
justify-content: flex-end;
align-items: flex-end;
}
<div>Div (flex)</div>
<button>Button (flex)</button>
Is there any way I can get align-items: flex-end;
to work with the button, or is there any alternative way to have the text of a given <button>
display in the bottom-left hand corner of that button?
Browser: I am using Firefox 57.0.4