I'm starting in the html area and I'm doing a few pages for myself (for testing) and in one I did have some radiobuttons
, the issue is that I'd like to leave them compulsory to select 2 of them, one in each area, and that the selected colors were not the same, type has to be different colors. type, the letter color can not be the same as the background color. Let's say the user selects the black color, and if he selects black on the background color will also display a msg: "Colors can not be the same". in case he will have to select different colors for the letter and background.
.bubble
{
border-radius: 10%;
width: 55px;
height: 55px;
display: inline-block;
box-shadow: inset 0px 2px 3px 0px rgba(0, 0, 0, .6), 0px 1px 0px 0px rgba(255, 255, 255, .10);
}
.bubble-sm
{
width: 20px!important;
height: 20px!important;
}
<br>COR DA LETRA<br><br>
<input type="radio" name="color" value="preto" required='true'><div class="bubble bubble-sm" style="background-color: #000000"></div>
<input type="radio" name="color" value="azul" required='true'><div class="bubble bubble-sm" style="background-color: #000080"></div>
<br><br>COR DO FUNDO<br><br>
<input type="radio" name="color2" value="preto" required='true'><div class="bubble bubble-sm" style="background-color: #000000"></div>
<input type="radio" name="color2" value="azul" required='true'><div class="bubble bubble-sm" style="background-color: #000080"></div>