I have problem with new line... I want Fontawesome icon be on top and text under that. Can someone explaing how to do it?
Here is my code:
.options_button{
float: left;
width: 113px;
height: 57px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
border-top-right-radius: 0px;
border-top-left-radius: 0px;
padding: 5px;
border: 2px solid;
border-color: #5f6a77;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">
<button class="options_button">
<i class="fas fa-image"></i>
Save
</button>
The easiest way is to use flexbox:
.options_button{
width: 113px;
height: 57px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
border-top-right-radius: 0px;
border-top-left-radius: 0px;
padding: 5px;
border: 2px solid;
border-color: #5f6a77;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">
<button class="options_button">
<i class="fas fa-image"></i>
Save
</button>
You can add a br to make a new line
.options_button {
float: left;
width: 113px;
height: 57px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
border-top-right-radius: 0px;
border-top-left-radius: 0px;
padding: 5px;
border: 2px solid;
border-color: #5f6a77;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">
<button class="options_button">
<i class="fas fa-image"></i>
<br/>Save
</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With