Hello,
I got a couple of questions:
- How do I keep all input boxes on 1 side/column and lined up, even the radio and checkbox?
- What’s the meaning of each character in the email pattern attribute?
- Why doesn’t my submit button have a black background?
Please have a look at my code:
<!-- file: index.html -->
<! DOCTYPE html>
<html lang="en">
<header>
<link rel="stylesheet" href="styles.css">
<title>
</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
</header>
<body>
<h1 id="title">SOUTHERN LABOR MARKET SURVEY</h1>
<p id="description"> By Florida Statistic Bureau </p>
<form id="survey-form">
<legend class ="legend">Personal Information</legend>
<label for="name" id="name-label">What's your name?</label>
<input required id="name" type="text" placeholder="Pamela Anderson" pattern="[._%+\-]">
<label for="email" id="email-label">What's your email?</label>
<input required id="email" type="email" placeholder="user@domain.TLD" pattern="[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,}$">
<label for="number" id="number-label">What's your birthyear? </label>
<input type="number" id="number" min="1957" max="2004" placeholder="1958">
<label for="dropdown">Where are you living?</label>
<select id="dropdown">
<option>State</option>
<option>Florida</option>
<option>Lousiana</option>
<option>Texas</option>
</select>
<legend class ="legend" name="employed">Question</legend>
<section>
Are you employed?
<input id="yes" type="radio" name="employed" value="Yes">
<label for="yes">Yes</label>
<input id="no" type="radio" name="employed" value="No">
<label for="no">No</label>
</section>
<section>
How do you look for work?
<input id="fair" type="checkbox" name="search" value="fair">
<label for="fair">Job fair</label>
<input id="Online" type="checkbox" name="search" value="Online">
<label for="Online">Online</label>
</section>
<label for="reason">If unemployed, why? </label>
<textarea id="reason"></textarea>
<input id="submit" type="submit">
</form>
</body>
</html>
/* file: styles.css */
#title {
font-size:30px;
text-align: center
}
#description {
text-align:center;
}
.legend {
text-transform:uppercase;
}
label {
//width:50%;
}
input, select {
//width:50%;
margin: 0 80% 0 35%;
//text-align:left;
//display: inline;
}
select {
padding: 1px 2px;
}
input[type="radio"],input[type="checkbox"] {
vertical-align: middle;
margin: 0 0 0 7%;
}
input[type="submit"] {
margin-top:450px;
blackground-color:black;
color:white;
margin: 0 auto;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0
Challenge Information:
Survey Form - Build a Survey Form