HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URL's added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<head>
<link rel="stylesheet" type="text/css" href="./test.css">
</head>
<div id="container-page">
<div class="container-survey">
<h1 id="title">freeCodeCamp Survey Form</h1>
<p id="description">Thank you for taking the time to help us improve the platform</p>
<form id="survey-form" name="surveyForm"> <!-- Should I use th form tag 'action' prop or the one from submit button at bottom? -->
<div class="container-questions">
<label id="name-label" class="questions" for="name">Name</label>
<input class="box-width" type="text" id="name" name="name" placeholder="Enter a Name here..." required>
</div>
<div class="container-questions">
<label id="email-label" class="questions" for="email">E-mail</label>
<input class="box-width" type="email" id="email" name="email" placeholder="Enter an e-mail here..." required>
</div>
<div class="container-questions">
<label id="number-label" class="questions" for="number">Age<pre> (optional)</pre></label>
<input class="box-width" type="number" id="number" name="age" min="1" max="9" placeholder="Enter a Number here...">
</div>
<div class="container-questions">
<label class="questions labelFselect" for="dropdown">Which option best describes your current role?</label>
<select id="dropdown" class="select-width">
<option disabled selected value>Select Option</option>
<option value="student">Student</option>
<option value="fulltimejob">Full Time Job</option>
<option value="fulltimelearner">Full Time Learner</option>
<option value="perfernottosay">Perfer Not To Say</option>
<option value="other">Other</option>
</select>
</div>
<div class="container-questions">
<label class="lone-label questions">Would you recommend freeCodeCamp to a friend?</label>
<div class="container">
<input type="radio" id="definately" name="recommend" value="Definately">
<label class="radio" for="definately">Definately</label>
</div>
<div class="container">
<input type="radio" id="maybe" name="recommend" value="Maybe">
<label class="radio" for="maybe">Maybe</label>
</div>
<div class="container">
<input type="radio" id="notsure" name="recommend" value="Not sure">
<label class="radio" for="notsure">Not sure</label>
</div>
</div>
<div class="container-questions">
<label class="questions labelFselect" for="favfeature">What is your favorite feature of freeCodeCamp?</label>
<select id="favfeature" class="select-width">
<option disabled selected value>Select 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="container-questions">
<label class="lone-label questions">What would you like to see improved?<pre> (Check all that apply)</pre></label>
<div class="container">
<input type="checkbox" id="frontend" name="frontend" value="Front-end Projects">
<label class="checkbox" for="frontend">Front-end Projects</label>
</div>
<div class="container">
<input type="checkbox" id="backend" name="backend" value="Back-end Projects">
<label class="checkbox" for="backend">Back-end Projects</label>
</div>
<div class="container">
<input type="checkbox" id="datavis" name="datavis" value="Data Visualization">
<label class="checkbox" for="datavis">Data Visualization</label>
</div>
<div class="container">
<input type="checkbox" id="challenges" name="challenges" value="Challenges">
<label class="checkbox" for="challenges">Challenges</label>
</div>
<div class="container">
<input type="checkbox" id="opensourcecom" name="opensourcecom" value="Open Source Cummunity">
<label class="checkbox" for="opensourcecom">Open Source Community</label>
</div>
<div class="container">
<input type="checkbox" id="gitter" name="gitter" value="Gitter help rooms">
<label class="checkbox" for="gitter">Gitter help rooms</label>
</div>
<div class="container">
<input type="checkbox" id="videos" name="videos" value="Videos">
<label class="checkbox" for="videos">Videos</label>
</div>
<div class="container">
<input type="checkbox" id="wiki" name="wiki" value="Wiki">
<label class="checkbox" for="wiki">Wiki</label>
</div>
<div class="container">
<input type="checkbox" id="forum" name="forum" value="Forum">
<label class="checkbox" for="forum">Forum</label>
</div>
<div class="container">
<input type="checkbox" id="addcourses" name="addcourses" value="Additional Courses">
<label class="checkbox" for="addcourses">Additional Courses</label>
</div>
</div>
<div class="container-questions">
<label id="id-comments" class="questions" for="comments">Any comments or suggestions?</label>
<textarea id="comments" class="box-width" name="comments" rows="4" cols="50" placeholder="Enter your comment here..."></textarea>
</div>
<div class="container-questions submit">
<!-- <input id="submit" type="button" value="submit" onclick="./action_page.php"> -->
<button id="submit" type="submit">Submit</button>
</div>
</form>
</div>
</div>
<!-- Link to CDN to test my work ----------------------------------------------------->
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script> -->
<!-- --------------------------------------------------------------------------------->
@import url('https://fonts.googleapis.com/css2?family=Bitter&display=swap');
* {
margin: 0;
padding: 0;
}
html {
max-width: 1000px;
margin: auto;
background-color: bisque;
background-image: url("https://humansbuyservices.files.wordpress.com/2014/11/istock_000018375225large.jpg");
background-repeat: repeat;
background-position: center;
background-blend-mode: soft-light;
background-size: 50%;
}
.container-survey {
margin: 10px 15% 0 15%;
}
h1 {
padding: 10px 10px 10px 10px;
text-align: center;
font-size: 2.5em;
}
p {
padding: 10px 10px 10px 10px;
text-align: center;
font-size: 1.40em;
}
form {
border: 1px solid black;
background-color: moccasin;
}
.container-questions {
padding: 15px 20px 15px 20px;
}
.container {
padding: 5px 5px 5px 0;
}
.questions {
font-family: Bitter;
font-size: 1.4em;
}
.radio, .checkbox {
padding-left: 10px;
vertical-align: 2.5px;
font-family: monospace, Courier;
font-size: 1.40em;
}
.lone-label, .labelFselect {
display: block;
}
.box-width {
width: 90%;
padding: 5px 20px 5px 20px;
border-radius: 8px;
font-size: 1.25em;
}
input[type=radio] {
height: 19px;
width: 19px;
}
.select-width {
width: 10em;
padding: 5px 20px 5px 20px;
border-radius: 8px;
font-size: 1em;
}
input[type=checkbox] {
height: 19px;
width: 19px;
}
label #id-comments {
display: block;
}
pre {
display: inline-block;
font-size: .75em;
}
#submit {
width: 10em;
padding: 10px 10px 10px 10px;
border-radius: 8px;
font-size: 26px;
cursor: pointer;
}
.submit {
text-align: center;
}
Also see: Tab Triggers