- Joined
- Aug 16, 2022
- Messages
- 52
- Reaction score
- 2
Hi Everybody,
The code I have provided will display this result:
What I want to display is this:
The positioning of the components is what's driving me nuts. I can not seem to get the Gender+RadioButton list and
the Age Group+RadioButton list on a single row.
There are going to be several different survey questions, so I do need to make the display based on CSS.
How, (or where) can learn how to properly use the <Div class="row???"> and <Div class="col"???>? It's still like learning
Klingon to me.
The code I have provided will display this result:
What I want to display is this:
The positioning of the components is what's driving me nuts. I can not seem to get the Gender+RadioButton list and
the Age Group+RadioButton list on a single row.
There are going to be several different survey questions, so I do need to make the display based on CSS.
How, (or where) can learn how to properly use the <Div class="row???"> and <Div class="col"???>? It's still like learning
Klingon to me.
HTML:
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<!-- Bootstrap Font Icon CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link rel="stylesheet" href="PlayRoom.css" type="text/css">
<title>PlayRoom</title>
</head>
<body>
<div class="form-container">
<h4>Optional</h4>
<div class="RadioArray">
<div class="row">
<div class="col-sm-5">
<!--<div class="input-group">-->
<span class="spread">Gender</span>
<!--</div>-->
<div class="RadioBox">
<div class="form-check">
<input type="radio" class="form-check-input" id="gender1" name="cGender" value="No Answer" checked >
<label class "form-check-label" for="gender1">Declined</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" id="gender2" name="cGender" value="Male" >
<label class "form-check-label" for="gender3">Male</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" id="gender3" name="cGender" value="Female" >
<label class "form-check-label" for="gender3">Female</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" id="gender4" name="cGender" value="Neutral" >
<label class "form-check-label" for="gender4">Neutral</label>
</div>
</div>
</div>
<div class="col-sm-5">
<!--<div class="input-group">-->
<span class="spread">Age</span>
<!--</div>-->
<div class="RadioBox">
<div class="form-check">
<input type="radio" class="form-check-input" id="cAge1" name="cAgeGroup" value="No Answer" checked />
<label class "form-check-label" for= 'cAge1'>Declined</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" id="cAge2" name="cAgeGroup" value="under 19" />
<label class "form-check-label" for= 'cAge2'>under 19</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" id="cAge3" name="cAgeGroup" value="19-40" />
<label class "form-check-label" for= 'cAge3'>19 to 40</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" id="cAge4" name="cAgeGroup" value="over 40" />
<label class "form-check-label" for= 'cAge4'>Over 40</label>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
CSS:
.form-container {
position: relative;
margin: 0 auto;
border-radius: 1.25rem;
border: 0.375rem solid;
border-color: #000000;
background-color: #FFFFFF;
box-shadow: #339900 0.625rem 1.25rem 1.25rem -0.625rem;
height: 30%;
width: 60%;
padding-top: 1.25rem;
}
.form-container .RadioArray {
width: 40rem;
align-self: center;
padding-left: 0.938rem;
padding-right: 0.938rem;
padding-top: 0.313rem;
padding-bottom: 0.313rem;
border-style: groove;
border-width: 0.125rem;
border-color: #000000;
background-color: #FF0000;
text-align: center;*/
}
.form-container .RadioBox {
width: fit-content;
padding-left: 0.938rem;
padding-right: 0.938rem;
padding-top: 0.313rem;
padding-bottom: 0.313rem;
border-style: groove;
border-width: 0.125rem;
border-color: #009900;
background-color: #B3FFB2;
border-radius: 1.25rem;
font-family: Cabin SemiBold, sans-serif;
text-align: center;
}
.form-container .spread {
padding-left: 1rem;
padding-top: .5rem;
font-family: Valken, serif;
color: #8A8A8A;
height: 2.5rem;
font-size: 1.150rem;
font-weight: lighter;
text-align: centre;
}
h4 {
font-family: fantasy, "Cabin Medium";
font-size: 1.50rem;
font-weight: bold;
color: #CCCCCC;
text-align: center;
}