For some reason when I try to do label>
How Many Times do you Play Per Week?<label
right above my radio inputs, the text from the label doesn't show up. When I try it in any other place such as at the end of the radio inputs it works. It only doesn't work before the radio inputs.
.bcontainer {
height: 800px;
width: 550px;
background-color: rgba(245, 245, 220, .95);
margin-left: auto;
margin-right: auto;
border-radius: 5px;
margin-bottom: 15px;
margin-top: 15px;
border: 2.5px solid black;
}
label {
display: block;
margin: 15px;
color: black;
font-family: verdana;
}
fieldset {
margin: 0;
padding: 0;
border: 0;
}
input {
width: 100%;
margin-top: 10px;
color: white;
background-color: black;
border: 1px solid black;
min-height: 2em;
}
}
.align {
vertical-align: middle;
width: unset;
margin: 0 10px 0 0;
}
<div class="hcontainer">
<h1 id="title">Game Type Survey</h1>
<p id="description"><em>Thank you for your response!</em></p>
</div>
<div class="bcontainer">
<form id="survey-form" action="https://register-demo.freecodecamp.org">
<fieldset>
<label id="name-label">Username: <input type="text" name="username" id="name" placeholder="username" required>
</label>
<label id="email-label">Email: <input id="email" type="email" name="address" placeholder="email" required>
</label>
<label id="number-label">Age: <input id="number" type="number" min="21" max="120" name="age" placeholder="21">
</label>
<label>Which Wallet Do You Use? <select name="wallet" id="dropdown" required>
<option value="">Select Wallet</option>
<option value="1">MetaMask</option>
<option value="2">Coinbase</option>
<option value="3">Wallet Connect</option>
</fieldset>
<fieldset>
<label>How Many Times do you Play Per Week?</label>
<label><input type="radio" name="#oftimes" class="align" value="1">0-1</label>
<label><input type="radio" name="#oftimes" class="align" value="2">2-7</label>
<label><input type="radio" name="#oftimes" class="align" value="3">8+</label>
You haven't closed both the <label>
and <select>
elements before it. Close those and it should work, like this:
<label>Which Wallet Do You Use?</label>
<select name="wallet" id="dropdown" required>
<option value="">Select Wallet</option>
<option value="1">MetaMask</option>
<option value="2">Coinbase</option>
<option value="3">Wallet Connect</option>
</select>
I recommend finding out how to 'auto-indent' on your code editor of choice, or otherwise get in the habit of keeping perfect indentation, as issues like these are really easy to spot and avoid when the code is indented correctly :) It also makes everything a lot tidier and easier to work with!