Basically, I have two buttons that have the same style and are lined beside each other inside a parent div.
<div style="text-align: center">
<button class="btn btn-primary button1">Button1</button>
<button class="btn btn-primary button2">Button2</button>
</div>
.btn {
min-height: 44px;
width: 100%;
max-width: 320px;
position: relative;
box-sizing: border-box;
padding: 6px 24px
border-radius: 4px;
outline: none;
cursor: pointer;
&.btn-primary {
border: none;
background-color: #808080;
color: #FFFFFF;
}
&.button1{
background-color: #FFFFFF;
color: #000000;
border: 1px solid #b6b6b6;
}
&.button2{
margin-left: 12px;
width: auto;
padding: 6px 36px;
}
}
Because the second button is translated in lots of languages, its width is set to auto. The problem here is that the first button must have the same dynamic width as the second one at all times.
So, is there a way to achieve this condition on the first button by only using CSS? Keep in mind that the buttons are lined on the same row.