Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <html>
<head>
  <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
  <link href="https://fonts.googleapis.com/css?family=Yellowtail|Montserrat&display=swap" rel="stylesheet">
</head>
<body>
<header style="z-index: 100;">
  <h1 class="logo"> 
    Irish Surveys 
  </h1> 
</header>
<main>
  <div id="first-div" class="main-card">
    <h1 id="title"> Please fill out this survey! </h1>
    <form id="survey-form"> 
      <p id="description"> This is a survey designed to learn about how x affects y </p>
      <div class="question">
        <label for="name" id="name-label">
          *Name: 
        </label>
        <div class="answer">
          <input required name="name" autofocus id="name" type="text" placeholder=" Your name">
        </div>
      </div>
      <div class="question">
        <label for="email" id="email-label">
          *Email: 
        </label>
        <div class="answer">
          <input required id="email" type="email" placeholder=" Your email">
        </div>
      </div>
  
      <div class="question">
        <label for="number" id="number-label" id="number-label">
          Student number: 
        </label>
        <div class="answer">
          <input id="number" type="number" min="10000000" max="99999999" placeholder=" Your student number">
        </div>
      </div>
        
      <div class="question">
        <label for="course">
          *Select your course:
        </label>
        <div class="answer">
          <select type="dropdown" id="dropdown">
            <option disabled value>
              <i>Select your course</i>
            </option>
            <option value="theoreticalPhysics">
              Theoretical Physics
            </option>
            <option value="maths">
              Mathematics
            </option>
            <option value="tsm">
              TSM Maths 
            </option>
            <option value="physics">
              Physics
            </option>
            <option value="science">
              General Science
            </option>
            <option value="other">
              Other course
            </option>
            <option value="notInCollege">
              Not in undergrad
            </option>
          </select>
        </div>
      </div>
        
      <div class="question">
        <label for="collegeYear">
          *What year are you in / have you completed?
        </label>
        <div class="answer">
          <ul style="list-style: none;" class="radio-list" class="collegeYear">
            <li class="radio"> <label> 
              <input name="collegeYear" type="radio" value="0" class="collegeYear"> Not in college    
            </label> </li>
            <li class="radio"><label> 
              <input name="collegeYear" type="radio" value="1" checked class="collegeYear"> 1st Year 
            </label></li>
            <li class="radio"><label> 
              <input name="collegeYear" type="radio" value="2" class="collegeYear"> 2nd Year 
            </label></li>
            <li class="radio"><label> 
              <input name="collegeYear" type="radio" value="3" class="collegeYear"> 3rd Year 
            </label></li>
            <li class="radio"><label> 
              <input name="collegeYear" type="radio" value="4" class="collegeYear"> 4th Year 
            </label></li>
            <li class="radio"><label> 
            </label></li>
            <li class="radio"><label> 
              <input name="collegeYear" type="radio" value="5" class="collegeYear"> Master's 
            </label></li>
            <li class="radio"><label> 
              <input name="collegeYear" type="radio" value="6" class="collegeYear"> PhD Programme
            </label></li>
            <li class="radio"><label> 
              <input name="collegeYear" type="radio" value="7" class="collegeYear"> Higher 
            </label></li>
          </ul>
        </div>
      </div>
      
      <div class="question">
        <label for="uses">
          *What do you use this site for?
        </label>
        <div class="answer">
          <ul class="checkbox-list">
            <li class="checkbox"><label>
              <input name="uses" value="1" type="checkbox"> 
              Checking for Homeworks
            </label></li>
            <li class="checkbox"><label>
              <input name="uses" value="2" type="checkbox"> 
              Looking when assignements are due
            </label></li>
            <li class="checkbox"><label>
              <input name="uses" value="3" type="checkbox"> 
              Looking at lecture notes and slides
            </label></li>
            <li class="checkbox"><label>
              <input name="uses" value="4" type="checkbox"> 
              Quick links to different lecturer pages
            </label></li>
            <li class="checkbox"><label>
              <input name="uses" value="5" type="checkbox"> 
              Reviewing things from previous semesters
            </label></li>
            <li class="checkbox"><label>
              <input name="uses" value="6" type="checkbox"> 
              Downloading my personal notes
            </label></li>
            <li class="checkbox"><label>
              <input name="uses" value="7" type="checkbox"> 
              Seeing what modules I do in my course
            </label></li>
            <li class="checkbox"><label>
              <input name="uses" value="8" type="checkbox"> 
              Catching up on materials
            </label></li>
            <li class="checkbox"><label>
              <input name="uses" value="9" type="checkbox"> 
              Other (please specify): 
            </label></li>
            <li class="other"><label>
              <input name="uses" type="text" id="otherUses" placeholder=" Other reasons"> 
            </label></li>
          </ul>
        </div>
      </div>
      <div class="question">
        <label for="comments"> Do you want any other features to be implemented on my website or have any other comments?
        </label>
        <div class="answer">
          <textarea class="comments" id="comments" placeholder="Suggestions or comments..."></textarea>
        </div>
      </div>
      <br>
      <div class="question">
        <button id="submit"> Submit Answers </button>
      </div>
    </form>
  </div>
</main>
<footer>
  Thank you for taking part in this survey!
</footer>
</body>
</html>
              
            
!

CSS

              
                body {
  font-family: Montserrat, sans serif;
  font-size: 1.5em;
  text-align:center;
  margin: 0px;
  background-color: #ccf;
  --lightColor: #ffe;
  --darkColor:  #1ad;
}

header {
  position: fixed;
  width: 100%;
  padding: 10px 0px;
  background-color: #fff;
  background-color: var(--lightColor);
  z-index: 100;
  box-shadow: 0px 0px 4px 3px rgb(0,0,0,0.3);
}

.logo {
  margin: 0px;
  z-index: 101;
  color: green;
  color: var(--darkColor);
  font-family: 'Yellowtail', cursive;
}

main {
  position: flex;
  width: 100%;
  padding: 20px 0px 10px;
  background-color: green;
  background-color: var(--darkColor);
  align-self: center;
}

footer {
  width: 100%;
  position: flex;
  padding: 10px 0px;
  background-color: var(--lightColor);
  
}

.main-card{
  width: 98%;
  max-width: 900px;
  margin: auto auto 1em auto;
  position: flex;
  align-self: center;
  background-color: white;
  background-color: var(--lightColor);
  box-shadow: 0px 3px 3px 3px rgb(0,0,0,0.3);
}

#first-div {
  margin-top: 3.5em;
}

#title {
  padding: 32px 0px 0px;
}

.question {
  margin: 10px;
  width: 100%;
}

.question > label {
  width: 39%;
  text-align: right;
  display: inline-block;
  vertical-align: top;
}

.question > .answer {
  display: inline-block;
  margin-left: 1%;
  width: 57%;
  text-align: left;
}

input, select, textarea, button {
  font-size: 1em;
}
input[type="radio"], input[type="checkbox"] {
  width: 0.8em;
  height: 0.8em;
}

form {
  padding-bottom: 32px;
}

.radio-list, .checkbox-list {
  list-style: none;
  margin: 0px;
  padding-left: 0px;
}

.comments {
  min-height: 4.1em; 
  width: 90%;
  resize: vertical;
  margin-top: 5px;
}

button {
  background-color: green;
  background-color: var(--darkColor);
  padding: 5px;
  border: 10px solid var(--darkColor);
  border-radius: 1em;
  color: white;
  font-weight: bold;
}
              
            
!

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