CSS examples¶
Custom widths¶
Copy this code into your form CSS editor to use the custom widths
/*----Custom Widths----*/
/* How to use
- Copy all of the CSS inside this document and paste it into the CSS section in Form Designer
- Now you can simply go to any question in the form and specify a width you want in the CSS class field
- Example: To make a question take 60% of the width, write: w-60 inside the CSS class field in the question settings
- You can add more custom widths in the same way the widths below are created.
---
- Example: To add 75% width -> paste the follwing CSS to the CSS code below:
.Question.w-75 {
width: 75%;
display: inline-block;
}
- *Important - Be sure to add the new class to the media breakpoints further down in the document so the questions will be responsive to different screen sizes.
-Example: Also add the w-75 class after *Media breakpoint at 620px* and replace "width: 75%" with "width: 50%" (this makes the 75% width questions to 50% after the screen size is narrower than 620px). :
.Question.w-75 {
width: 50%;
display: inline-block;
}
and add the w-75 class after *Media breakpoint at 420px* and replace "width: 75%" with "width: 100%" (this makes the 75% width questions to 100% after the screen size is narrower than 420px).
.Question.w-75 {
width: 100%;
display: inline-block;
}
---
*/
.Question.w-100 {
width: 100%;
}
.Question.w-90{
width: 90%;
display: inline-block;
}
.Question.w-80 {
width: 80%;
display: inline-block;
}
.Question.w-70 {
width: 70%;
display: inline-block;
}
.Question.w-60 {
width: 60%;
display: inline-block;
}
.Question.w-50 {
width: 50%;
display: inline-block;
}
.Question.w-40 {
width: 40%;
display: inline-block;
}
.Question.w-35 {
width: 35%;
display: inline-block;
}
.Question.w-33 {
width: 33.3%;
display: inline-block;
}
.Question.w-30 {
width: 30%;
display: inline-block;
}
.Question.w-25 {
width: 25%;
display: inline-block;
}
.Question.w-20 {
width: 20%;
display: inline-block;
}
.Question.w-10 {
width: 10%;
display: inline-block;
}
/*Media breakpoint at 620px*/
@media only screen and (max-width : 620px) {
.Question.w-100 {
width: 100%!important;
}
.Question.w-90{
width: 100%!important;
}
.Question.w-80 {
width: 100%!important;
}
.Question.w-70 {
width: 100%!important;
}
.Question.w-60 {
width:100%!important;
}
.Question.w-50 {
width: 50%!important;
}
.Question.w-40 {
width: 50%!important;
}
.Question.w-35 {
width: 50%!important;
}
.Question.w-33 {
width: 50%;
display: inline-block;
}
.Question.w-30 {
width: 50%!important;
}
.Question.w-25 {
width: 50%;
display: inline-block;
}
.Question.w-20 {
width: 50%!important;
}
.Question.w-10 {
width: 50%!important;
}
}
/*Media breakpoint at 420px*/
@media only screen and (max-width : 420px) {
.Question.w-50 {
width: 100%!important;
}
.Question.w-40 {
width: 100%!important;
}
.Question.w-35 {
width: 100%!important;
}
.Question.w-33 {
width: 100%;
display: inline-block;
}
.Question.w-30 {
width: 100%!important;
}
.Question.w-25 {
width: 100%;
display: inline-block;
}
.Question.w-20 {
width: 100%!important;
}
.Question.w-10 {
width: 100%!important;
}
}
Custom radio button¶
Copy this code into your form CSS editor to use the custom buttons
/*---Custom radio button, ---*/
/*How to use
- Copy all of the CSS inside this document and paste it into the CSS section in Form Designer
- Create or go to a single answers question in the form and choose the template: Buttons
- Paste: n-custom-radio inside the CSS classes field in the question's settings
- Now the buttons should instead look like checkboxes
Change the color of the radio button
- In order to change to colors of the radio button, you can make some adjustments to the CSS code below
- Scroll down and look for the comments that states where you can adjust the colors
*/
.n-custom-radio span {
box-shadow: none!important;
}
.n-custom-radio .qtButton .Answer.Selected label span {
background: transparent;
color: inherit;
margin-top:1px;
}
.n-custom-radio .qtButton label span {
border-radius: 0px;
border: 0px;
padding: 2px 10px;
}
.desktop .n-custom-radio .qtButton label span:hover {
background: transparent;
color: inherit;
}
.n-custom-radio [type="radio"]:checked,
.n-custom-radio [type="radio"]:not(:checked) {
display: none;
}
.n-custom-radio [type="radio"]:checked + span, .n-custom-radio [type="radio"]:not(:checked) + span {
position: relative;
padding-left: 28px;
cursor: pointer;
line-height: 20px;
display: inline-block;
color: #666;
}
.n-custom-radio [type="radio"]:checked + span:before, .n-custom-radio [type="radio"]:not(:checked) + span:before {
content: '';
position: absolute;
left: 0;
top: 10;
width: 18px;
height: 18px;
border: 1px solid #ddd; /*Here you can change the border color of an unchecked radio button*/
border-radius: 100%;
background: #fff; /*Here you can change the background color of an unchecked radio button*/
}
.n-custom-radio [type="radio"]:checked + span:after, .n-custom-radio [type="radio"]:not(:checked) + span:after {
content: '';
width: 12px;
height: 12px;
background: #66bb6a; /*Here you can change the background color of a checked radio button*/
position: absolute;
top: 6px;
left: 4px;
border-radius: 100%;
-webkit-transition: all 0.2s ease;
transition: all 0.2s ease;
}
.n-custom-radio [type="radio"]:not(:checked) + span:after {
opacity: 0;
-webkit-transform: scale(0);
transform: scale(0);
}
.n-custom-radio [type="radio"]:checked + span:after {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
.n-custom-radio [type="radio"]:checked + span:before {
border: 1px solid #66bb6a; /*Here you can change the border color of a checked radio button*/
}
Custom check-boxes¶
Copy this code into your form CSS editor to use the custom check-boxes
/*----Custom Checkbox---*/
/*How to use
- Copy all of the CSS inside this document and paste it into the CSS section in Form Designer
- Create or go to a multiple answers question in the form and choose the template: Buttons
- Paste: n-custom-check inside the CSS classes field in the question's settings
- Now the buttons should instead look like checkboxes
Change the color of the checkbox
- In order to change to colors of the checkbox, you can make some adjustments to the CSS code below
- Scroll down and look for the comments that states where you can adjust the colors
*/
.n-custom-check span {
box-shadow: none!important;
}
.n-custom-check .qtButton label span {
border-radius: 0px;
border: 0px;
padding: 2px 10px;
}
.desktop .n-custom-check .qtButton label span:hover {
background: transparent;
color: inherit;
}
.n-custom-check [type="checkbox"]:checked,
.n-custom-check [type="checkbox"]:not(:checked) {
display: none;
}
.n-custom-check [type="checkbox"]:checked + span, .n-custom-check [type="checkbox"]:not(:checked) + span {
position: relative;
padding-left: 28px;
cursor: pointer;
line-height: 20px;
display: inline-block;
color: #666;
}
.n-custom-check [type="checkbox"]:checked + span:before, .n-custom-check [type="checkbox"]:not(:checked) + span:before {
content: '';
position: absolute;
left: 0;
top: 10;
width: 18px;
height: 18px;
border-radius: 2px;
background: #fff; /*Here you can change the background color of an unchecked checkbox */
border: 1px solid #ddd; /*Here you can change the border color of an unchecked checkbox */
}
.n-custom-check [type="checkbox"]:checked + span:after, .n-custom-check [type="checkbox"]:not(:checked) + span:after {
content: '';
position: absolute;
left: 5px;
top: 11px;
background: white;
width: 2px;
height: 2px;
box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white, 4px -4px 0 white, 4px -6px 0 white, 4px -8px 0 white;
transform: rotate(45deg);}
.n-custom-check [type="checkbox"]:not(:checked) + span:after {
opacity: 0;
-webkit-transform: scale(0);
transform: scale(0);
}
.n-custom-check [type="checkbox"]:checked + span:after {
opacity: 1;
}
.n-custom-check [type="checkbox"]:checked + span:before {
background: #66BB6A; /*Here you can change the background color of a checked checkbox */
border-color: #66BB6A; /*Here you can change the border color of a checked checkbox */
}
.n-custom-check .qtButton .Answer.Selected label span {
background: transparent;
color: inherit;
}