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.
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<div class="container my-3 p-0">
<div class="bg pt-3">
<header class="header">
<div class="row m-0">
<div class="col">
<h1 id="title" class="text-center">Serafina Hotel </h1>
<p id="description" class="description text-center"> Please, tell us what you think about our hotel</p>
</div>
</div>
</header>
<!--Form-->
<form class="mb-3 p-5" id="survey-form">
<!-- Name - Room -->
<div class="row">
<div class="col-12 col-sm-6">
<div class="form-group">
<label id="name-label" for="name">Name</label>
<input type="text" name="name" id="name" class="form-control" placeholder="Enter your name" required />
</div>
</div>
<div class="col-12 col-sm-6">
<div class="form-group">
<label id="room-label" for="number">Room<span class="clue"> (optional) </span></label>
<input type="number" name="room" id="number-room" class="form-control" placeholder="room" min=100 max=180 step=10 />
</div>
</div>
</div>
<!-- Reason - Equipped -->
<div class="row">
<div class= "col-12 col-sm-6">
<div class="form-group">
<label for="dropdown" id="visit-label" >What was the reason for your visit?</label>
<select class="form-control" name="visit" id="dropdown">
<option disabled selected value> Please Select</option>
<option value="business">Business Trip</option>
<option value="conference">Conference</option>
<option value="event">Local event</option>
<option value="fish">Holiday</option>
</select>
</div>
</div>
<div class="col-12 col-sm-6">
<div class="form-group">
<label for="r_equipament">How well-equipped was your room?</label>
<select id="r_equipament" class="form-control" name="room-equipament">
<option disabled selected value> Please Select</option>
<option value="equipped">Extremely well-equipped</option>
<option value="Moderately">Moderately well-equipped</option>
<option value="not">Not at all well-equipped</option>
</select>
</div>
</div>
</div>
<!-- Choose - Staff -->
<div class="row mb-3">
<div class="col-12 col-sm-6">
<p>Why did you choose this hotel?</p>
<div class="form-check">
<input id="location" name="prefer" value="location" type="checkbox" class="form-check-input"/><label class="form-check-label" for="location"> Location </label>
</div>
<div class="form-check">
<input id="amenities" name="prefer" value="amenities" type="checkbox" class="form-check-input"/><label class="form-check-label" for="amenities"> Amenities<span class="clue"> (Wi-fi,Spa...)</span></label>
</div>
<div class="form-check">
<input id="accessibility" name="prefer" value="accessibility" type="checkbox" class="form-check-input"/><label class="form-check-label" for="accessibility"> Accessibility </label>
</div>
<div class="form-check">
<input id="loyality" name="prefer" value="Programs" type="checkbox" class="form-check-input"/><label class="form-check-label" for="loyality"> Loyalty Programs and Frequent Flier Miles</label>
</div>
</div>
<div class="col-12 col-sm-6 mt-3 mt-sm-0">
<p>How frendy were the hotel staff member?</p>
<div class= "form-check">
<input id="fr_extremely" name="staff-recommend" value="extremely" type="radio"
class="form-check-input" checked/><label class="form-check-label" for="fr_extremely"> Extremely Friendy</label>
</div>
<div class= "form-check">
<input id="fr_moderately" name="staff-recommend" value="quite" type="radio"
class="form-check-input" checked/><label class="form-check-label" for="fr_moderately"> Moderately Friendy</label>
</div>
<div class= "form-check">
<input id="fr_not" name="staff-recommend" value="moderatly" type="radio"
class="form-check-input" checked/><label class="form-check-label" for="fr_not"> Not at all Friendy</label>
</div>
</div>
</div>
<!-- Quick - Again -->
<div class="row mb-3">
<div class="col-12 col-sm-6">
<p>How quick was the check-in in the process?</p>
<div class= "form-check">
<input id="qk_extremely" name="staff-recommend" value="extremely" type="radio"
class="form-check-input" checked/><label class="form-check-label" for="qk_extremely"> Extremely Quick</label>
</div>
<div class= "form-check">
<input id="qk_moderately" name="staff-recommend" value="quite" type="radio"
class="form-check-input" checked/><label class="form-check-label" for="qk_moderately"> Moderately Quick</label>
</div>
<div class= "form-check">
<input id="qk_not" name="staff-recommend" value="no" type="radio"
class="form-check-input" checked/><label class="form-check-label" for="qk_not"> Not at all Quick</label>
</div>
</div>
<div class="col-12 col-sm-6 mt-3 mt-sm-0">
<p>How likely are you to stay at our hotel again?</p>
<div class="form-check">
<input id="lk_extremely" name="staff-recommend" value="extremely" type="radio"
class="form-check-input" checked/><label class="form-check-label" for="lk_extremely"> Extremely likely</label>
</div>
<div class= "form-check">
<input id="lk_quite" name="staff-recommend" value="quite" type="radio"
class="form-check-input" checked/><label class="form-check-label" for="lk_quite"> Quite likely</label>
</div>
<div class= "form-check">
<input id="lk_not" name="staff-recommend" value="no" type="radio"
class="form-check-input" checked/><label class="form-check-label" for="lk_not"> Not at all likely</label>
</div>
</div>
</div>
<!-- Better -->
<div class="row">
<div class="col">
<div class="form-group">
<p>We could we do to make your stay better?</p>
<textarea class="form-control" id="comments" rows="3" name="comment" placeholder="Enter your comment here..."></textarea>
</div>
</div>
</div>
<!-- Recommend -->
<div class="row">
<div class="col">
<div class="form-group">
<label id="number-label" for="number">Would you recommend our hotel?</label><input type="number" name="recomend" id="number" min="1" max="5" class="form-control" placeholder="1 - Awful, 3 - Neutral, 5 - Great"/>
</div>
</div>
</div>
<!-- Email -->
<div class="row">
<div class="col">
<div class="form-group">
<label id="email-label" for="email">Email</label>
<input type="email" name="email" id="email" class="form-control" placeholder="Enter your Email" required/>
</div>
</div>
</div>
<!-- Send -->
<div class= "row justify-content-end">
<div class= col-3>
<button type="submit" class=" send-btn btn btn-primary btn-lg px-4" id="submit" >Send</button>
</div>
</div>
</form>
</div>
</div>
:root {
}
.container, .bg {
border-radius: 2rem;
}
.container {
color: #eee;
height: 100%;
width: 100%;
background: url(https://images.pexels.com/photos/5371683/pexels-photo-5371683.jpeg) no-repeat center;
background-size: cover;
z-index: -1;
}
.bg {
background: linear-gradient(to top, rgba(0,30,90, .5) 0%, rgba(100,180,180, .9) 100%);
}
.send-btn {
font-size: 20px;
border: none;
}
button:hover {
animation-name: background-color;
animation-duration: 800ms;
animation-fill-mode: forwards;
text-shadow: 0 0 30px white;
}
@keyframes background-color {
100% {
background-color: #4791d0;
}
}
// !! 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.
Also see: Tab Triggers