Hello, Is it possible to change the layout of specific questions without overriding the whole layout of the survey? Specifically, I currently have a theme that has the following layout (Classic): I want to continue having this theme, however, for certain questions, I would prefer having checkboxes (for multiple choice) or radio buttons (for single choices) (example below, with Flat as the Layout): Any help would be appreciated. Please let me know if I should elaborate.
You can add css to specific pages to override the default css by placing the new rules inside a
tag in the question text of a question on a page. If you want it to apply only to specific questions on a page, add the question id to your css rules (e.g., #QID1).
TomG Thank you for your answer and for being so helpful! I now understand that I can override a default feature by embedding the code as ] However, I still don't know the exact CSS function/element I need within the HTML tag to override the button style. Specifically, I want the following style - the Minimal 2014 theme: Do you know how to precisely go about changing the style from regular buttons to the checkboxes for a specific question? Thank you in advance!
Hi MilBu , if you still need, I was able to follow TomG's recommendation but using the check boxes from the 'Flat' layout. The below code will put the checkboxes from the 'Flat' layout in place for Multiselect question that use the Classic Layout for a single page. In the Question Text of any question on a page, add the below to the HTML/Source view "<>" using the Rich Content Editor:
Great job providing the solution TomG! 👏 and thank you Tom_1842 for circling back and providing additional custom code! The community team loves your contributions! 🙂
The code above was able to work for me as well! And I replaced all the ‘.MultipleAnswer’ with
‘.SingleAnswer’ for a single -select question. The checkboxes are appearing and the functionality is there, however I was wondering if radio buttons can be used instead of check boxes? Which part of the code will need to be updated to use radio buttons instead of check boxes?
I tried changing the ‘q-checked’ to ‘q-radio’, but the survey still shows the answer choices with a checkbox rather than a radio button.
@KellanMagaoay I built on the above for a better blending of Classic layout and the Radio buttons/Checkboxes from the Flat layout. Using the Classic layout as a base, the below will work to:
add Radio buttons to Single Answer Multiple Choice questions for Vertical and Horizontal alignments
add Checkboxes to Multiple Answer Multiple Choice questions for Vertical and Horizontal alignments
As this thread is about question/page level styling, I wrap it all in a <style> tag so it can be included inside Question Text HTML, but it could all be added as CSS to the Style section of the Look and Feel if you wanted Radio buttons and Checkboxes for Multiple Choice questions throughout a Classic layout survey.
If you only want this to only apply to Single Answer Multiple Choice questions, remove any lines of code that include .MultipleAnswer, .MAVR, or .MAHR.
<styletype="text/css">/*Adding Radio Buttons and Checkboxes from Flat layout to Classic*//*Adding for Vertical alignments*//*Adds space for vertical Radio buttons and Checkboxes*/.Skin.MAVRlabel.MultipleAnswer, .Skin.SAVRlabel.SingleAnswer{
position: relative;
padding-left:40px !important;
}/*Format the space where the vertical Radio buttons and Checkboxes are*/.Skin.MAVRlabel.MultipleAnswer>span::before, .Skin.SAVRlabel.SingleAnswer>span::before{
position: absolute;
top:50%;
margin-top: -0.7em;
}/*Create Checkboxes for vertical multiselects*/.Skin.MAVRlabel.MultipleAnswer>span::before{
content:"";
display: inline-block;
width:17px;
height:17px;
left:10px;
vertical-align: middle;
margin-right:10px;
border-radius:3px;
border:2px solid #9b9b9b;
border-image: initial;
background:00!important;
}/*Format the vertical Checkboxes when selected*/.Skin.MAVRlabel.MultipleAnswer.q-checked>span::before{
background:#26B6EAurl(/jfe/themes/base-templates/qualtrics/base/version-1658262440254-05dae3/files/check.svg) no-repeat center center !important;
background-size:85% !important;
border:2px solid #007ac0!important;
-webkit-animation: check .2s forwards;
-moz-animation: check .2s forwards;
-o-animation: check .2s forwards;
animation: check .2s forwards;
}/*Create vertical Radio buttons for single selects*/.Skin.SAVRlabel.SingleAnswer>span::before{
content:"";
display: inline-block;
width:17px;
height:17px;
left:10px;
vertical-align: middle;
margin-right:10px;
border-radius:100%;
border:2px solid #9b9b9b;
border-image: initial;
background:00!important;
}/*Format the vertical Radio button when selected*/.Skin.SAVRlabel.SingleAnswer.q-checked.q-focused>span::before, .Skin.SAVRlabel.SingleAnswer.q-checked>span::before{
border:2px solid #007ac0;
background:#26B6EA!important;
-webkit-box-shadow: inset 0003px #fff;
-moz-box-shadow: inset 0003px #fff;
box-shadow: inset 0003px #fff;
-webkit-animation: radio .2s forwards;
-moz-animation: radio .2s forwards;
-o-animation: radio .2s forwards;
animation: radio .2s forwards;
}/*Adds space for Horizontal Radio buttons and Checkboxes for Horizontal alignment*//*Adds formatting for Horizontal Radio buttons and Checkboxes selected*/.Skin.SAHRlabel.q-radio{
height:21px !important;
width:21px !important;
border:2px solid #9b9b9b!important;
}.Skin.SAHRlabel.q-radio.q-checked, .Skin.SAHRlabel.q-radio.q-checked.q-focused{
border:2px solid #007ac0!important;
background:#26B6EA!important;
-webkit-box-shadow: inset 0003px #fff!important;
-moz-box-shadow: inset 0003px #fff!important;
box-shadow: inset 0003px #fff!important;
-webkit-animation: radio .2s forwards !important;
-moz-animation: radio .2s forwards !important;
-o-animation: radio .2s forwards !important;
animation: radio .2s forwards !important;
}.Skin.MAHRlabel.q-checkbox{
height:20px !important;
width:20px !important;
-webkit-border-radius:2px !important;
-moz-border-radius:2px !important;
-ms-border-radius:2px !important;
-o-border-radius:2px !important;
border-radius:2px !important;
border:2px solid #9b9b9b!important;
}.Skin.MAHRlabel.q-checkbox.q-checked{
background:#26B6EAurl(/jfe/themes/base-templates/qualtrics/base/version-1658262440254-05dae3/files/check.svg) no-repeat center center !important;
background-size:85% !important;
border:2px solid #007ac0!important;
-webkit-animation: check .2s forwards !important;
-moz-animation: check .2s forwards !important;
-o-animation: check .2s forwards !important;
animation: check .2s forwards !important;
}/*phone and desktop*//*desktop, buttons below*/@media all and (min-width:480px){
.Skin.MC.MAHRtabletd, .Skin.MC.SAHRtabletd{
text-align: center !important;
}.Skin.MAHRtd.LabelContainer, .Skin.SAHRtd.LabelContainer{
margin-bottom:25px!important;
}.Skin.MAHRtd.LabelContatiner, .Skin.SAHRtd.LabelContatiner{
vertical-align: top !important;
position: relative !important;
}.Skin.MAHRlabel.MultipleAnswer.LabelPositionBELOW, .Skin.SAHRlabel.SingleAnswer.LabelPositionBELOW{
padding-left:20px!important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
text-align: center !important;
padding-top:5px !important;
padding-bottom:0!important;
}.Skin.MAHRtdlabel.q-checkbox, .Skin.SAHRtdlabel.q-radio{
display: block !important;
position: absolute !important;
left:calc(50% - 10px)!important;
bottom:5px !important;
cursor: pointer !important;
}.Skin.MAHRlabel.MultipleAnswer.LabelPositionBELOW>span, .Skin.SAHRlabel.SingleAnswer.LabelPositionBELOW>span{
padding-bottom:35px !important;
}
}
/*phone*//*phone, buttons on side*/@media all and (max-width:479px){
.Skin.MAHRlabel.MultipleAnswer, .Skin.SAHRlabel.SingleAnswer{
position: relative;
padding-left:40px !important;
}/*Format the space where the Radio buttons and Checkboxes are*/.Skin.MAHRlabel.MultipleAnswer>span::before, .Skin.SAHRlabel.SingleAnswer>span::before{
position: absolute;
top:50%;
margin-top: -0.7em;
}/*Create Checkboxes for multiselects*/.Skin.MAHRlabel.MultipleAnswer>span::before{
content:"";
display: inline-block;
width:17px;
height:17px;
left:10px;
vertical-align: middle;
margin-right:10px;
border-radius:3px;
border:2px solid #9b9b9b;
border-image: initial;
background:00!important;
}/*Format the Checkboxes when selected*/.Skin.MAHRlabel.MultipleAnswer.q-checked>span::before{
background:#26B6EAurl(/jfe/themes/base-templates/qualtrics/base/version-1658262440254-05dae3/files/check.svg) no-repeat center center !important;
background-size:85% !important;
border:2px solid #007ac0!important;
-webkit-animation: check .2s forwards;
-moz-animation: check .2s forwards;
-o-animation: check .2s forwards;
animation: check .2s forwards;
}/*Create Radio buttons for single selects*/.Skin.SAHRlabel.SingleAnswer>span::before{
content:"";
display: inline-block;
width:17px;
height:17px;
left:10px;
vertical-align: middle;
margin-right:10px;
border-radius:100%;
border:2px solid #9b9b9b;
border-image: initial;
background:00!important;
}/*Format the Radio button when selected*/.Skin.SAHRlabel.SingleAnswer.q-checked.q-focused>span::before, .Skin.SAHRlabel.SingleAnswer.q-checked>span::before{
border:2px solid #007ac0;
background:#26B6EA!important;
-webkit-box-shadow: inset 0003px #fff;
-moz-box-shadow: inset 0003px #fff;
box-shadow: inset 0003px #fff;
-webkit-animation: radio .2s forwards;
-moz-animation: radio .2s forwards;
-o-animation: radio .2s forwards;
animation: radio .2s forwards;
}/*Adds space for Radio buttons and Checkboxes for Horizontal alignment*/.Skin.MAHRlabel.MultipleAnswer.LabelPositionBELOW, .Skin.SAHRlabel.SingleAnswer.LabelPositionBELOW{
padding-left:40px !important;
padding-right:40px !important;
align-items: center !important;
justify-content: center !important;
text-align: center !important;
height:100% !important;
}.Skin.MAHRlabel.MultipleAnswer.LabelPositionBELOW>span, .Skin.SAHRlabel.SingleAnswer.LabelPositionBELOW>span{
padding-bottom:0px !important;
}
}
</style>
Click to write the question text