1
HTML:
<div class="row">
<div class="col-md-4">
<a href="#" class="qualificationbox">
<h2 class="title">Junior</h2>
<img src="images\getquote\junior.png" >
<p class="info">dsadasdsff fsd fsd fds fds f sef sdf s </p>
</a>
</div>
<div class="col-md-4">
<a href="#" class="qualificationbox">
<h2 class="title">Medium</h2>
<img src="images\getquote\medium.png" >
<p class="info">dsadasdsff fsd fsd fds fds f sef sdf s </p>
</a>
</div>
<div class="col-md-4">
<a href="#" class="qualificationbox">
<h2 class="title">Senior</h2>
<img src="images\getquote\senior.png" >
<p class="info">dsadasdsff fsd fsd fds fds f sef sdf s </p>
</a>
</div>
</div>
css:
I have these classes that define the values I will have initially:
.qualificationbox {
position: relative;
display: block;
padding: 1.5em .5em;
margin-bottom: 1.5em;
border-radius: .5em;
background: #fafbfc;
text-align: center;
height: 100%;
color: #ff0000;}
.qualificationbox .info {
color: inherit;}
.qualificationbox .title {
text-transform: uppercase;
margin: 0;
color: inherit;}
by clicking, or by hovering over, I wanted to replace the qualificationbox with the qualificationboxselect:
.qualificationboxselect {
position: relative;
display: block;
padding: 1.5em .5em;
margin-bottom: 1.5em;
border-radius: .5em;
background: #ff0000;
text-align: center;
height: 100%;
color: #fff;}
.qualificationboxselect .title {
text-transform: uppercase;
margin: 0;
color: inherit;}
.qualificationboxselect .info {
color: inherit;}
But there can only be one selected (qualificationboxselect), ie if I have the "junior" selected and select the "medium", I intended to remove the "junior". Is it possible for someone to help me, Thank you.
thanks for the help, I have only one question, to have for example the first selected, and to select the second, I intended that the first was deselected, and the second be selected, I do not know if I was very explicit, thank you.
– José Vitório
got @Josévitório. In that case just remove the class
qualificationboxselect
of all elements first. I did this in the code, see the example. I also added a validation to know if the clicked element already had the class, to be able to apply at the end (toggle)– Ricardo Pontual
Thank you @Ricardo Pontual
– José Vitório
@Josévitório, if the answer solved your question, do not forget to accept the answer as correct
– Ricardo Pontual