6
I need to do a quiz, and the alternatives are radio inputs, but it looks like custom checkbox.
What’s the best way to do that?
.tabs-below > .nav-tabs,
.tabs-right > .nav-tabs,
.tabs-left > .nav-tabs {
border-bottom: 0;
}
.tab-content > .tab-pane,
.pill-content > .pill-pane {
display: none;
}
.tab-content > .active,
.pill-content > .active {
display: block;
}
.tabs-below > .nav-tabs {
border-top: 1px solid #ddd;
}
.tabs-below > .nav-tabs > li {
margin-top: -1px;
margin-bottom: 0;
}
.tabs-below > .nav-tabs > li > a {
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
.tabs-below > .nav-tabs > li > a:hover,
.tabs-below > .nav-tabs > li > a:focus {
border-top-color: #ddd;
border-bottom-color: transparent;
}
.tabs-below > .nav-tabs > .active > a,
.tabs-below > .nav-tabs > .active > a:hover,
.tabs-below > .nav-tabs > .active > a:focus {
}
.tabs-left > .nav-tabs > li,
.tabs-right > .nav-tabs > li {
float: none;
}
.tabs-left > .nav-tabs > li > a,
.tabs-right > .nav-tabs > li > a {
text-align: center;
border: none !important;
min-width: 54px;
height: 25px;
margin-right: 0;
margin-bottom: 3px;
}
.tabs-right > .nav-tabs {
float: right;
margin-left: 19px;
}
.tabs-right > .nav-tabs > li > a {
margin-left: -1px;
margin-bottom: 7px;
background-color: #1d1715;
color: white;
font-family: 'Citroen-bold-italic';
font-size: 12pt;
opacity: 0.5;
padding: 3px;
}
.tabs-right > .nav-tabs > li > a:active {
}
.tabs-right > .nav-tabs > li > a:hover,
.tabs-right > .nav-tabs > li > a:focus {
background-color: #f1ba26;
}
.tabs-right > .nav-tabs .active > a,
.tabs-right > .nav-tabs .active > a:hover,
.tabs-right > .nav-tabs .active > a:focus {
background-color: #f1ba26;
opacity: 1;
border-radius: 0;
}
.arrow-left {
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid blue;
}
#quiz {
font-family: 'Citroen-bold-italic';
color: #fff;
}
#quiz {
text-align: right;
}
label {
display: inline-block;
cursor: pointer;
position: relative;
padding-right: 25px;
margin-left: 15px;
font-size: 13px;
}
input[type=radio] {
display: none;
}
label:after {
content: "";
display: inline-block;
width: 16px;
height: 16px;
margin-left: 0px;
position: absolute;
right: 0;
bottom: 1px;
background-color: #424242;
border: 2px solid #212121;
}
.radio label:after {
border-radius: 2px;
}
input[type=radio]:checked + label:after {
content: "\2713";
color: #E0E0E0;
font-size: 15px;
text-align: center;
line-height: 18px;
}
<div class="tabbable tabs-right">
<ul class="nav nav-tabs">
<li class="active abas"><a href="#1" data-toggle="tab">1</a></li>
<li><a href="#2" data-toggle="tab">2</a></li>
<li><a href="#3" data-toggle="tab">3</a></li>
<li><a href="#4" data-toggle="tab">4</a></li>
<li><a href="#5" data-toggle="tab">5</a></li>
<li><a href="#6" data-toggle="tab">6</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="1">
<p>Lorem ipsum dolor sit amet, charetra varius quam sit vulputate.</p>
<input id="1a" na type="radio"><label for="1a">Lorem ipsum dolor sit </label>
<input id="1b" type="radio"> <label for="1b">Lorem ipsum dolor sit </label>
<input id="1c" type="radio"><label for="1c">Lorem ipsum dolor sit </label>
<button class="pull-right">RESPONDER</button>
</div>
Here you go several examples of stylization of a radio button, some with Javascript others only with CSS.
– mgibsonbr
By the way, you ask for "checkbox", but the reference image looks more like a "toggle button" (from what I understand, this yellow "1" would be the option chosen, if the user clicked on "4" for example then it would turn yellow while "1" would be deleted. Is that it? ). What do you really want?
– mgibsonbr
No. The tabs on the right are the question numbers.
– fronthendy
What I’m looking for is a checkbox for the alternatives
– fronthendy
Got it, the big text is the title and the three small texts are the alternatives... Is that as there was only one placeholder for the text, it was not clear what was what.
– mgibsonbr
This question is being discussed at the Meta.
– mgibsonbr
Hi Hendy. Glad you solved the problem ! I don’t know if you followed the discussion linked above by @mgibsonbr, but something happened here to avoid: you totally changed the question after there was already a posted answer (and voted). This does not work well here on the site, because the answer that already existed has not worked for the new question. In such cases, post a separate question (and include links to other, related ones if necessary). Here we have rules and mechanisms a little different from most other sites (forums), but over time you get the hang of it. Good learning!
– bfavaretto
@bfavaretto Thanks! I really failed at this point rs .
– fronthendy