Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <body>
    <div class="container">
    <section class="header-container">
        <h1 id="title">The mysterious image</h1>
        <h2>WARNING!!!</h2>
        <p id="description">Beware of hovering over the black rectangle, as it would reveal a picture of something absolutely terrifying. Don't say you haven't been warned. You are doing this at your own peril and I will not be held responsible for any harm it may do to you!</p>
    </section>
<div class="img-container">
    <span id="cover"></span>
    <img src="https://i.redd.it/blnswl35qxr31.jpg" alt="">
</div>
<section class="form-container">
<h2>Now that you uncovered the truth, please fill in the survey form, to let me know about the intense emotions you felt.</h2>
<form id="survey-form">
<div id="name-container" class="form-entry">
    <label id="name-label" for="name">Name*:</label>
        <input type="text" id="name" name="name"
        placeholder="Please enter your name" required/>
</div>
<div id="email-container" class="form-entry">
    <label id="email-label" for="email">Email*:</label>
        <input type="email" id="email" name="email" placeholder="Please enter your email"  required/>
</div>
<div id="age-container" class="form-entry">
    <label id="number-label" for="age">Age<span class="clue">(optional)</span>:</label>
        <input type="number" id="number" name="age" min="8" max="120" placeholder="Enter your age"/>
</div>
<div id="dropdown" class="form-entry">
    <p>Chose one of the following, to describe the feeling you had after seeing the picture:</p>
    <select id="dropdown" name="feeling" required>
        <option selected="true" disabled="disabled">Please select one of the following:</option>
        <option value="bamboozled">Bamboozled</option>
        <option value="awww">Awwwwwwwwww</option>
        <option value="ohmy">OMG OMG OMG OMG</option>
        <option value="boop">I booped the snoot and broke my screen...</option>
    </select>
</div>
<div id="radio" class="form-entry">
    <p>Are you better now that you saw the picture?</p>
    <div class="radio1">
    <label for="yes">
        <input type="radio" id="yes" value="yes" name="better"/>Yes</label>
    </div>
    <div class="radio2">
    <label for="no">
        <input type="radio" id="no" value="no" name="better"/>No</label>
    </div>
    <div class="radio3">
    <label for="maybe">
        <input type="radio" id="maybe" value="maybe" name="better"/>Maybe</label>
    </div>
</div>
<div id="dropdown1" class="form-entry">
    <p>What made you hover the image?</p>
    <select id="dropdown" name="why" required>
        <option selected="true" disabled="disabled">Please select one of the following:</option>
        <option value="curiosity">I was just curious</option>
        <option value="duel">I thought you were bluffing </option>
        <option value="rebel">I do whatever I want, you can't stop me</option>
        <option value="boored">I was booooooored</option>
    </select>
</div>
<div id="checkbox" class="form-entry">
    <p>What did you expect to see when you clicked the image?</p>
    <div class="check1">
    <input type="checkbox" id="scary" value="scary" name="expectations">
        <label for="scary">Something very scary!</label>
    </div>
    <div class="check2">
    <input type="checkbox" id="man" value="man" name="expectations">
        <label for="man">A man in mankini..</label>
    </div>
    <div class="check3">
    <input type="checkbox" id="gps" value="gps" name="expectations">
        <label for="gps">The GPS location of a huge treasure!</label>
    </div>
    <div class="check4">
    <input type="checkbox" id="sexy" value="sexy" name="expecations">
        <label for="sexy">A super hot <strong>grill</strong>.</label>
    </div>
    <div class="check5">
    <input type="checkbox" id="div" value="div" name="expectations">
        <label for="div">Information about centering a div, inside another div.</label>
    </div>
</div>
<div class="form-entry">
    <p>If any questions or comments:</p>
    <textarea id="qs-comm" placeholder="Enter your questions or comments here:"></textarea>
</div>
    <div id="button" class="form-entry">
        <button type="submit" id="submit">Submit</button>
    </div>
</form>
</section>
</div>
    <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
    <footer>
        <p>This survey form has been created by Albert, for <a style="text-decoration: none; color: #fa9c9c" href="https://www.freecodecamp.org/" target="_blank">freecodecamp</a> certification project.
        </p>
    </footer>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Playfair+Display:400,700&display=swap');

:root {
    --paragraph-font-size: 1.4rem;
}

body {
    background-color: #333333;
}

*, body, section {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Playfair Display', serif;
}

h1 {
    padding: .5em;
    margin-top: 1em;
    text-align: center;
    font-size: 3.5rem;
    color: #ffffff;
}
.container {
    width: 100%;
    margin: auto;
}
.header-container h2 {
    text-align: center;
    font-size: 1.9rem;
    padding: 1.2em;
    animation-name: warning;
    animation-iteration-count: infinite;
    animation-duration: 1.2s;
}

@keyframes warning {
    0% {
        color: rgb(255, 255, 255);
    }
    50% {
        color: red;
    }
    100% {
        color: rgb(255, 255, 255);
    }
}

.header-container p {
    padding: .7em;
    font-size: var(--paragraph-font-size);
    text-align:center;
    line-height: 2.3rem;
    color: #ffffff;
}

.img-container {
    padding: 0;
    margin: 5em 0;
    background-color: #000;
    border-top: 1px;
    border-bottom: 1px;
    border-left: 0px;
    border-right: 0px;
    border-color: #000;
    border-style: solid;
    position: relative;
}

img {
    width: 100%;
    opacity: 0;
    margin-top: .25em;
    transition: 1s;
}

img:hover {
    opacity: 1;
}

.form-container {
    width: 100%;
    padding: .3em;
}

.form-container h2 {
    text-align: center;
    font-size: 1.8rem;
    margin: 0 0 3em;
    color: #ffffff;
}

.form-entry {
    width: 100%;
    padding: 1em;
    margin-bottom: 1em;;
    border-radius: 1em;
    background-color: #fa9c9c;
    color: #333333;
    font-size: var(--paragraph-font-size);
}

#name-container, #email-container, #age-container, #age-container input {
    display: block;
}
#name-container input, #email-container input, #age-container input {
    padding: 1em;
    width: 100%;
    margin: auto;
    border-radius: .5em;
    border: none;
    font-size: calc(var(--paragraph-font-size) - .3em);
}
#dropdown, #dropdown1 {
    padding: 1em;
    width: 100%;
    margin: auto;
    border: none;
    font-size: calc(var(--paragraph-font-size) - .3em);
}
#dropdown p, #dropdown1 p {
    font-size: var(--paragraph-font-size);
}
#dropdown1 option {
    font-size: calc(var(--paragraph-font-size) - .3em);
}
#dropdown select, #dropdown1 select {
    border-radius: .5em;
    margin-bottom: .3em;
}
#radio, #checkbox {
    display: inline-block;
    width: 100%;
    margin-top: 1em;;
}
#checkbox p, #radio p {
    margin-bottom: .6em;
}
#checkbox input, #radio input {
    cursor: pointer;
}
#checkbox input[type=checkbox], #radio input[type=radio] {
    transform: scale(1.5);
    margin-right: .5em;
}
textarea {
    resize: vertical;
    width: 100%;
    min-height: 10em;
    border-radius: .5em;
}
textarea::placeholder {
    font-size: calc(var(--paragraph-font-size) - .5em);
}
#button {
    margin: auto;
    width: 75%;
}
button {
    width: 60%;
    margin: auto;
    padding: 1em 2em;
    display: block;
    border-radius: .5em;
    border: none;
    text-align: center;
    font-size: 1rem;
    background-color: #333333;
    color: #ffffff;
    cursor: pointer;
    transition: .5s;
}
button:hover {
    background-color: #242424;
}
footer {
    width: 100%;
    text-align: center;
    padding: 2em;
    margin-top: 2em;
    background-color: #3f3f3f;
    color: #fff;
}

@media screen and (min-width: 300px) {
    h1 {
        font-size: 3em;
    }
}
@media screen and (min-width: 400px) {
    .container {
        width: 90%;
    }
}
@media screen and (min-width: 700px) {
    .container {
        width: 80%;
    }
}
@media screen and (min-width: 900px) {
    .container {
        width: 70%;
    }
}
@media screen and (min-width: 1300px) {
    .container {
        width: 60%;
    }
}
/* ONLY FOR DESKTOP
@keyframes warning {
    0% {
        transform: rotate(-10deg) scale(1.1);
        color: rgb(255, 255, 255);
    }
    50% {
        transform: rotate(10deg) scale(1.3);
        color: red;
    }
    100% {
        transform: rotate(-10deg) scale(1.1);
        color: rgb(255, 255, 255);
    }
}
*/










    

              
            
!

JS

              
                // !! 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. 

              
            
!
999px

Console