I have a demo here
Its a simple button inside a div
There is one button and then two buttons next to each other
I need to use the same button class for all the buttons
With the two button I need space between the buttons
I can do this with margin left and right but then that is used on the button on its own but I don't want it used when it's on it's own.
Is it possible to space the two buttons and have all the buttons use the same class.
.block{
border: 1px solid #ddd;
padding: 20px;
width: 300px;
display: flex;
margin-bottom: 10px;
.button{
&:first-child {
margin-right: 8px;
}
&:last-child {
margin-left: 8px;
}
}
}
.button{
border: 0;
background: red;
border-radius: 5px;
color: white;
padding: 10px;
width: 100%;
}