JSFiddle - React, Tailwind, and code Playground
by davehol
HTML
<div class="wFormContainer">
<div class="">
<div class="wForm" id="tfa_0-WRPR" dir="ltr">
<div class="codesection" id="code-tfa_0"></div>
<form method="post" action="https://www-forms.rmit.edu.au/responses/processor" class="hintsTooltip labelsRightAligned" id="tfa_0">
<fieldset id="tfa_1" class="section">
<legend id="tfa_1-L">Categories</legend>
<div id="tfa_7-D" class="oneField required ">
<div class="formrow">
<div class="column">
<span class="oneChoice"><label class="postField lbe_container" id="tfa_8-L" for="tfa_8">Sciences<input type="checkbox" value="tfa_8" class="" checked="" id="tfa_8" name="tfa_8"><span class="checkmark"></label></span></div>
<div class="column"> <span class="oneChoice"><label class="postField lbe_container" id="tfa_9-L" for="tfa_9">Health<input type="checkbox" value="tfa_9" class="" checked="" id="tfa_9" name="tfa_9"><span class="checkmark"></label></span></div>
<div class="column"><span class="oneChoice"><label class="postField lbe_container" id="tfa_10-L" for="tfa_10">Technology<input type="checkbox" value="tfa_10" class="" checked="" id="tfa_10" name="tfa_10"><span class="checkmark"></label></span></div>
</div>
<div class="formrow">
<div class="column"> <span class="oneChoice"><label class="postField lbe_container" id="tfa_11-L" for="tfa_11">Business and Entrepreneurship<input type="checkbox" value="tfa_11" class="" checked="" id="tfa_11" name="tfa_11"><span class="checkmark"></label></span></div>
<div class="column"> <span class="oneChoice"><label class="postField lbe_container" id="tfa_12-L" for="tfa_12">Art, design and culture<input type="checkbox" value="tfa_12" class="" checked="" id="tfa_12" name="tfa_12"><span class="checkmark"></label></span></div>
<div class="column"><span class="oneChoice"><label class="postField lbe_container"...
CSS
* {
box-sizing: border-box;
}
.wFormContainer {
margin-top: 50px;
}
/* Create three equal columns that floats next to each other */
.column {
float: left;
width: 33.33%;
padding: 0px;
height: 60px;
/* Should be removed. Only for demonstration */
}
/* Clear floats after the columns */
.formrow::after {
content: "";
display: table;
margin-left: 1px;
clear: both;
}
/* Responsive layout - makes the three columns stack on top of each other instead of next to each other */
@media screen and (max-width:1000px) {
.column {
width: 100%;
}
}
@media screen and (max-width:750px) {
fieldset {
padding-left: 0 !important;
padding-right: 0 !important;
}
legend {
margin-left: 0 !important;
}
input[type=submit] {
margin-right: 0 !important;
}
}
.lbe_container {
display: block;
position: relative;
padding-left: 40px;
margin-bottom: 30px;
cursor: pointer;
font-family: HelveticaNeue, sans-serif;
font-size: 24px;
font-weight: normal;
color: #333;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* Hide the browser's default checkbox */
.lbe_container input {
position: absolute;
opacity: 0;
cursor: pointer;
}
/* Create a custom checkbox */
.checkmark {
position: absolute;
top: -2px;
left: 0;
height: 28px;
width: 28px;
background-color: #f0f0f0;
border-radius: 3px;
border: solid 2px #646464;
}
/* On mouse-over, add a grey background color */
.lbe_container:hover input ~ .checkmark {
background-color: #f0f0f0;
}
/* When the checkbox is checked, add a blue background */
.lbe_container input:checked ~ .checkmark {
background-color: #f0f0f0;
}
/* Create the checkmark/indicator (hidden when not checked) */
.checkmark::after {
content: "";
position: absolute;
display: none;
}
/* Show the checkmark when checked */
/* Style the checkmark/indicator */
.lbe_container input:checked ~ .checkmark::after {
...