I need to make a background for my switch theme buttons but i’am stuck in this part
this is my code in the switch theme buttom part
<div class="themeContainer">
<p>calc</p>
<div>
<span class="themeText">THEME</span>
<span class="btnContainer">
<button id="switchTheme1">1</button>
<button id="switchTheme2">2</button>
<button id="switchTheme3">3</button>
</span>
</div>
</div>
First i made a <span> container so the other elements would not break line, but as a span is naturally displayed inline i can’t change it’s height.
After that i tried to change the btnContainer to display: inline-block; but it didn’t work
Now i’m a bit lost,i would appreciate if someone could help me in this matter.
.themeContainer {
color: hsl(0, 0%, 100%);
width: 535px;
height: 40px;
display: flex;
justify-content: space-between;
align-items: center;
}
.themeContainer p {
font-size: 30px;
margin-left: 10px;
}
.themeContainer .btnContainer {
background-color:hsl(224, 36%, 15%);
border-radius: 50%;
}
.themeContainer .themeText {
font-size: 12px;
margin-right: 10px;
}
.themeContainer button {
color: hsl(0, 0%, 100%);
background-color:hsl(224, 36%, 15%);
font-size: 12px;
max-width: 50px;
max-height: 50px;
width: 20px;
height: 20px;
margin: -1px;
border-radius: 50%;
border-style: none;
cursor: pointer;
}
2
Answers
I’d prefer you to use the
radio-input
to achieve this with someCSS-selectors
.You can make some final adjustments .. But I edited THIS CODEPEN to suit your needs.