Hello,
I passed the “survey form”, but I encounter a problem difficlte to fix the inputs radio.
Could you explain to me why whith this code bellow, the radio butons and labels are perfectly aligned with one above the other:
<!DOCTYPE html>
<html>
<head>
<title>Cours JavaScript</title>
<meta charset="utf-8" />
<style>
.form1 {
/* display: flex; */
/* align-items: center; */
}
.bouton {
/* display: inline-block; */
}
</style>
</head>
<body>
<div class="form1">
<input
id="recommend"
class="bouton"
type="radio"
name="recommend"
/>Definite<br />
<input
id="recommend"
class="bouton"
type="radio"
name="recommend"
/>Definite
</div>
</body>
</html>
The result is;
And now, with the code bellow which corresponding at the moment when I encountered this problem:
<!DOCTYPE html>
<html>
<head>
<title>Cours JavaScript</title>
<meta charset="utf-8" />
<style>
body {
/* position: fixed; */
background-image: linear-gradient(
115deg,
rgba(58, 58, 158, 0.8),
rgba(136, 136, 206, 0.7)
),
url(https://cdn.freecodecamp.org/testable-projects-fcc/images/survey-form-background.jpeg);
width: 100%;
height: 100%;
z-index: -1;
background-size: cover;
/* background-position: center;
background-repeat: no-repeat; */
font-family: 'Poppins', sans-serif;
font-size: 1rem;
font-weight: 400;
line-height: 1.4;
color: white;
background-color: darkblue;
/* margin: 0; */
}
#container {
width: 720px;
background-color: rgb(241, 210, 157);
margin:auto;
padding: 0px;
}
input {
width: 100%;
}
#survey-form {
width: 720px;
background-color: blue;
}
</style>
</head>
<body>
<div id="container">
<header>
<h1 id="title">sfsfsff</h1>
<p id="description"></p>
</header>
<form id="survey-form">
<div class="div-input">
<label class="label-input" for="name">Name:</label>
<input
id="name"
type="text"
name="name"
placeholder="Enter your name"
/>
</div>
<form id="survey-form">
<div class="div-input">
<label class="label-input" for="name">Name:</label>
<input
id="name"
type="text"
name="name"
placeholder="Enter your name"
/>
</div>
<form id="survey-form">
<div class="div-input">
<label class="label-input" for="name">Name:</label>
<input
id="name"
type="text"
name="name"
placeholder="Enter your name"
/>
</div>
<form id="survey-form">
<div class="div-input">
<label class="label-input" for="name">Name:</label>
<input
id="name"
type="text"
name="name"
placeholder="Enter your name"
/>
</div>
<div>
<p class="option">Would you recommend freeCodeCamp to a friend?</p>
<label for="recommend">
<input id="recommend" class="bouton" value="Definitely" type="radio" name="recommend">Definitely<br>
</label>
<label for="recommend">
<input id="recommend" class="bouton" value="Maybe" type="radio" name="recommend">Maybe<br>
</label>
<label for="recommend">
<input id="recommend" class="bouton" value="Not sure" type="radio" name="recommend">Not sure<br>
</label>
</div>
</form>
</div>
</body>
</html>
the result is :
Why this difference ?