Hello,
The preview section isn’t displaying any of my code, HTML or CSS. When initially opening the project, the preview displays the code fine. However, whenever I click on any of the tabs, such as the instructions or styles.css tab, the preview display goes blank. This is also happening to me with lessons before the “Build a Survey Form” project, which leads me to believe that it may be a bug. Aside from that, the preview seems to display just fine on my phone’s web browser. I’m not sure if that information is useful, just thought I should include it.
Any help would be greatly appreciated.
Thank you!
My code so far
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width initial-scale=1.0">
<title>freecodecampsurvey</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="header">
<h1 id="title" class="text-center">freeCodeCamp Survey Form</h1>
<p id="description" class="text-center description">Thank you for your feedback! Happy Coding!</p>
</header>
<div class="container">
<form id="survey-form">
<div class="form-group">
<label id="name-label">Name</label>
<input
type="text"
id="name"
placeholder="Enter your name"
class="form-control"
required
>
</div>
<div class="form-group">
<label id="email-label">Email</label>
<input
type="email"
id="email"
placeholder="Enter your email"
class="form-control"
required
>
</div>
<div class="form-group">
<label id="number-label">Age<span class="aside">(optional)</span></label>
<input
type="number"
id="number"
min="10"
max="125"
placeholder="Age"
class="form-control"
>
</div>
<div class="form-group">
<label id="role-select">Which option best describes your current role?</label>
<select id="dropdown" name="role" class="form-control">
<option value="">Select current role</option>
<option value="student">Student</option>
<option value="full-time-job">Full-time Job</option>
<option value="full-time-learner">Full-time Learner</option>
<option value="prefer-not-to-say">Prefer not say</option>
<option value="other">Other</option>
</select>
</div>
<div class="form-group">
<p>Would you recommend freeCodeCamp to a friend?</p>
<label>
<input
type="radio"
id="definitely"
name="recommendation"
value="definitely"
class="input-radio"
checked
>Definitely
</label>
<label>
<input
type="radio"
id="maybe"
name="recommendation"
value="maybe"
class="input-radio"
>Maybe
</label>
<label>
<input
type="radio"
id="not-sure"
name="recommendation"
value="not-sure"
class="input-radio"
>Not Sure
</label>
</div>
<div class="form-group">
<p>What is your favorite feature of freeCodeCamp?</p>
<select id="fav-feat" name="favFeat" class="form-control">
<option value="">Select an option</option>
<option value="challenges">Challenges</option>
<option value="projects">Projects</option>
<option value="community">Community</option>
<option value="open-source">Open Source</option>
</select>
</div>
<div class="form-group">
<p>What would you like to see improved?<span class="aside">(check all that apply)</span></p>
<label>
<input
type="checkbox"
value="front-end-projects"
name="improve"
class="input-checkbox"
>Front-End Projects
</label>
<label>
<input
type="checkbox"
value="back-end-projects"
name="improve"
class="input-checkbox"
>Back-End Projects
</label>
<label>
<input
type="checkbox"
value="data-visualization"
name="improve"
class="input-checkbox"
>Data Visualization
</label>
<label>
<input
type="checkbox"
value="challenges"
name="improve"
class="input-checkbox"
>Challenges
</label>
<label>
<input
type="checkbox"
value="open-source-community"
name="improve"
class="input-checkbox"
>Open Source Community
</label>
<label>
<input
type="checkbox"
value="glitter-help-rooms"
name="improve"
class="input-checkbox"
>Glitter Help Rooms
</label>
<label>
<input
type="checkbox"
value="videos"
name="improve"
class="input-checkbox"
>Videos
</label>
<label>
<input
type="checkbox"
value="city-meetups"
name="improve"
class="input-checkbox"
>City Meetups
</label>
<label>
<input
type="checkbox"
value="wiki"
name="improve"
class="input-checkbox"
>Wiki
</label>
<label>
<input
type="checkbox"
value="forum"
name="improve"
class="input-checkbox"
>Forum
</label>
<label>
<input
type="checkbox"
value="additional-courses"
name="improve"
class="input-checkbox"
>Additional Courses
</label>
</div>
<div class="form-group">
<p>Any comments or suggestions?</p>
<textarea
id="comments"
name="comment"
placeholder="Enter your comments here..."
class="input-textarea"
></textarea>
</div>
<div class="form-group">
<button id="submit" type="submit" class="submit">
Submit
</button>
</div>
</form>
</div>
</body>
</html>
/* CSS */
body {
font-family: monospace;
font-size: 1rem;
font-weight: 400;
line-height: 1.4;
color: white;
background-image:url(https://storage-prtl-co.imgix.net/endor/articles/434/images/1663928047_shutterstock_2083362643.jpg?max-w=660&max-h=532&fit=crop&auto=format,compress&q=40);
background-position: center;
background-size cover;
margin: 0;
}
.container {
width: 700px;
margin: 3.125rem auto 0 auto;
background-color: rgba(0,0,0,0.5);
border-style: none;
border-radius: 10px;
}
.form-group {
margin: 0;
padding: 2rem;
}
.input-radio,
.input-checkbox {
display: inline-block;
margin-right: 0.625rem;
min-height: 1.25rem;
min-width: 1.25rem;
}
.header {
padding-top:3rem;
margin-bottom: 1.875rem;
}
.text-center {
text-align: center;
}
.form-control {
display: block;
width: 100%;
height: 2.375rem;
padding: 0.375rem 0.75rem;
color: #495057;
background-color: white;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: 0.25rem;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.aside {
margin-left: 0.25rem;
font-size: 0.9rem;
color: white;
}
.input-textarea {
min-height: 120px;
width: 100%;
padding: 0.625rem;
resize: vertical;
}
.description {
font-style: italic;
font-weight: 200;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
}
.submit {
display: block;
width: 100%;
padding: 0.75rem;
border-radius: 2px;
cursor: pointer;
}
h1 {
font-weight: 400;
line-height: 1.4;
font-size: 40px;
}
p {
font-size: 1.125rem;
}
h1,
p {
margin-top: 0;
margin-bottom: 0.5rem;
}
label {
display: flex;
align-items: center;
font-size: 1.125rem;
margin-bottom: 0.5rem;
}
input,
button,
select,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button {
border: none;
background-color: #6666ff;
color: rgb(225,225,225)
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Challenge: {{challengeTitle}} Survey Form - Build a Survey Form
Link to the challenge: