There is a big div which contains two buttons which are at the end.
<big-div> <small-div>my text</small-div> <button1><button2></big-div>
I want the text inside small-div
to be centered with respect to the big-div
ignoring the buttons. Now it not in center but a little closer to the left side because of the buttons.
CSS files:
.big-div {
display: flex;
}
.button1 {
float: right;
margin-right: 0;
margin-left: .25em;
}
.button2 {
float: right;
margin-right: 0;
margin-left: .25em;
}
.small-div {
font-weight: 600;
font-size: 32px;
line-height: 40px;
letter-spacing: 0.02em;
text-align: center;
color: #0d1e2c;
margin: 10px 0;
}
Any suggestions about how to "ignore" the buttons when positioning the text?
.big-div {
display: flex;
background-color: red;
width:100%;
height: 100px;
}
.small-div {
font-style: normal;
font-weight: 600;
font-size: 32px;
line-height: 40px;
letter-spacing: 0.02em;
text-align: center;
color: #0d1e2c;
margin: 10px 0;
}
.buttons {
float: right;
margin-right: 0;
margin-left: .25em;
}
<div class="big-div">
<div class="small-div">my text</div>
<button class="buttons">button1</button>
<button class="buttons">button2</button>
</div>