7
I own this radio group
which serves to specify the severity level of a given occurrence, using the colors to classify the level.
Behold:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<style>
.btn-default.amarelo{
background: yellow;
}
.btn-default.amarelo:hover{
background: rgb(240, 240, 0);
}
.btn-default.amarelo.active{
background: rgb(230, 230, 0);
}
.btn-default.laranja{
background: orange;
}
.btn-default.laranja:hover{
background: rgb(255, 140, 0);
}
.btn-default.laranja.active{
background: rgb(255, 125, 0);
}
.btn-default.vermelho{
background: red;
}
.btn-default.vermelho:hover{
background: rgb(240, 0, 0);
}
.btn-default.vermelho.active{
background: rgb(230, 0, 0);
}
</style>
</head>
<body>
<h1>
Nível de gravidade
</h1>
<div class="form-group">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default active">
<input type="radio" value="B" checked autocomplete="off"> Branco
</label>
<label class="btn btn-default amarelo">
<input type="radio" value="A" autocomplete="off"> Amarelo
</label>
<label class="btn btn-default laranja">
<input type="radio" value="L" autocomplete="off"> Laranja
</label>
<label class="btn btn-default vermelho">
<input type="radio" value="V" autocomplete="off"> Vermelho
</label>
</div>
</div>
</body>
</html>
Note that when I select one of the color options and then remove the focus from radio button
, the radio button
that he is selected is almost imperceptible, seeming that he is not selected. This may confuse the user, leading him to believe that he did not correctly select the desired option.
Questions
- How could I make the
radio button
selected if stand out among the others? - There could be a visual effect on the selected option?
I believe that in this way the user would not get confused in question of this.
PS: The radio button
that is selected can not have its color changed, because it has a purpose.
White is not appearing in white xD
– Randrade
@Randrade already put it away, now it’s all right ;)
– hugocsl