Skip to content

Instantly share code, notes, and snippets.

@GrimDerp
Last active November 20, 2022 10:05
Show Gist options
  • Save GrimDerp/115e73351bd00e62d35eb0fb275fe2b8 to your computer and use it in GitHub Desktop.
Save GrimDerp/115e73351bd00e62d35eb0fb275fe2b8 to your computer and use it in GitHub Desktop.
Responsive Web Design Projects - Build a Survey Form
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<!doctype html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<h1 style="text-align:center" id="title" style="center" >Super Duper Survey Form</h1>
<p id="description">
<legend style="text-align:center">What do you like about Stuff and Things</legend>
</p>
<div class="container">
<fieldset>
<input type="radio" name="gender" value="male" checked> Stuff<br>
<input type="radio" name="gender" value="female"> Things<br>
<input type="radio" name="gender" value="other"> Stuff and Things<br>
<input type="radio" name="gender" value="other"> Not Sure
<form id="survey-form" method="GET">
<input type="text" name="name" id="survey-form" class="input-field" placeholder="Enter your Handle" required>
<input type+"text" name="email" id="email" class="input-field" placeholder="Enter your email" required><!--#4-->
<button>Click me!</button>
</fieldset>
</form>
<fieldset>
<div class="item1">Rainbows</div>
<div class="item2">Unicorns</div>
<div class="item3">
<div class="itemOne">Ninjas</div>
<div class="itemTwo">Kittens</div>
</div>
<div class="item4">Ninja Kittens</div>
</div>
</fieldset>
<div class="container2">
<fieldset>
<div class="item1">1</div>
<div class="item2">2</div>
<div class="item3">3</div>
<div class="item4">4</div>
<div class="item5">5</div>
</fieldset>
</div>
<footer></footer>
// !! IMPORTANT README:
// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place.
/***********
INSTRUCTIONS:
- Select the project you would
like to complete from the dropdown
menu.
- Click the "RUN TESTS" button to
run the tests against the blank
pen.
- Click the "TESTS" button to see
the individual test cases.
(should all be failing at first)
- Start coding! As you fulfill each
test case, you will see them go
from red to green.
- As you start to build out your
project, when tests are failing,
you should get helpful errors
along the way!
************/
// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!
// Once you have read the above messages, you can delete all comments.
<style>
header {
font-size: 2em;
font-weight: bold;
margin: 20px;
text-align: center;
}
.p{
text-area: center;
font-size: 40px;
min-height: 100px;
width: 100%;
background: LightGray;
display: grid;
grid-template-columns: repeat( auto-fill, minmax(60px, 1fr));
grid-template-rows: 1fr 1fr 1fr;
grid-gap: 10px;
}
input:invalid {
border: 2px dashed red;
}
input:valid {
border: 2px solid black;
}
.p {
font: roboto;
}
.container {
font-size: 1.5em;
min-height: 300px;
width: 100%;
background: LightGray;
display: grid;
grid-template-columns: auto 1fr;
grid-template-rows: auto 1fr auto;
grid-gap: 10px;
text-area: center;
grid-template-areas:
"header header"
"advert content"
"paragraph paragraph"
"form container"
"footer footer";
}
.container2 {
font-size: 40px;
min-height: 100px;
width: 100%;
background: Silver;
display: grid;
grid-template-columns: auto-fit repeat(3, minmax(60px, 1fr));
grid-template-rows: 1fr 1fr 1fr;
grid-gap: 10px;
}
.item1 {
background: LightSkyBlue;
grid-area: header;
text-area: center;
}
.item2 {
background: LightSalmon;
grid-area: advert;
text-area: center;
}
.item3 {
background: PaleTurquoise;
grid-area: content;
text-area: center;
}
.item4 {
background: lightpink;
grid-area: footer;
text-area: center;
}
.itemOne {
background: PaleGreen;
text-area: center;
}
.itemTwo {
background: BlanchedAlmond;
text-area: center;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment