I'm trying to display a header with a hr and a button at the same line. Something like this:
Header ------------------------------------ Button
I've tried with display flex, but the hr changed for a vertical line.
.flex-header {
display: flex;
}
<div class="flex-header">
<h2> Des habitations pour tous </h2>
<hr/>
<button> Collections </button>
</div>
You could just use a <div> with some css to create a <hr>-like line;
.flex-header {
display: flex;
}
.line {
display: flex;
flex-grow: 1;
height: 1px;
align-self: center;
margin: 0 20px;
background-color: grey;
}
<div class="flex-header">
<h2> Des habitations pour tous </h2>
<div class="line"></div>
<button> Collections </button>
</div>
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