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

              
                <!-- 

Hello Camper!

Please read the README below in the JS Editor before beginning. Feel free to delete this message once you have read it. Good luck and Happy Coding! 

- The freeCodeCamp Team 

-->

<h1 id="title">Discussion Group Form</h1>
	<p id="description">Please fill the form correctly</p>
	<form id="survey-form">
		<label for="name" id="name-label">
			Name
			<input type="text" id="name" placeholder="Enter your name" required>
		</label>
		<label for="email" id="email-label">
			Email
			<input type="email" id="email" placeholder="Enter your email" required>
		</label>
		<label for="number" id="number-label">
			Group Members
			<input type="number" id="number" placeholder="Number of Group Members" required min="3" max="7">
		</label>
		<label for="dropdown">
			Your group color
			<select id="dropdown" required>
				<option disabled selected>Select your option</option>
				<option>Red</option>
				<option>Blue</option>
				<option>Green</option>
				<option>Yellow</option>
				<option>Black</option>
			</select>
		</label>
		<label>
			Choose your topic
		</label>
		<div class="radio-group">
			<label>
				<input type="radio" name="table" value="1" checked>
				Religion
			</label>
			<label>
				<input type="radio" name="table" value="2">
				Politic
			</label>
			<label>
				<input type="radio" name="table" value="3">
				Terrorism
			</label>
			<label>
				<input type="radio" name="table" value="4">
				Communism & Capitalism
			</label>
			<label>
				<input type="radio" name="table" value="5">
				Flat Earth
			</label>
		</div>
		<label>Choose the book you have read</label>
		<div class="checkbox">
			<label>
				<input type="checkbox" name="checkbox" value="one">
				Book 1
			</label>
			<label>
				<input type="checkbox" name="checkbox" value="two">
				Book 2
			</label>
			<label>
				<input type="checkbox" name="checkbox" value="Three">
				Book 3
			</label>
			<label>
				<input type="checkbox" name="checkbox" value="Four">
				Book 4
			</label>
		</div>
		<label for="textarea">
			Suggestions about the Dicussion Group
			<textarea id="textarea" cols="30" rows="10" placeholder="Enter your suggestion here..."></textarea>
		</label>
		<button id="submit" type="submit">Submit</button>
	</form>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap');

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    color: white;
}

body::before {
    content: '';
    position: fixed;
    height: 100%;
    width: 100%;
    background: linear-gradient(55deg, rgba(106, 124, 83, 0.9), rgba(142, 155, 125, 0.9), rgba(55, 71, 105, 0.9)), url(https://cdn.freecodecamp.org/testable-projects-fcc/images/survey-form-background.jpeg);
    background-size: cover;
    background-repeat: no-repeat;
    z-index: -1;
    top: 0;
    left: 0;
}

body {
    font-family: 'Raleway', sans-serif;
    padding: 50px 40px;
    text-align: center;
}

h1#title {
    font-size: 2.5rem;
}

p#description {
    font-style: italic;
    font-size: 1.3rem;
}

form#survey-form {
    max-width: 700px;
    background-color: rgba(0, 0, 0, 0.8);
    margin: 20px auto;
    padding: 30px;
    text-align: left;
    border-radius: 10px;
    box-shadow: 5px 5px 20px rgba(31, 31, 31, 0.6);
}

form#survey-form label,
form#survey-form input,
form#survey-form select,
form#survey-form textarea {
    display: block;
}

form#survey-form label {
    font-size: 1.25rem;
    margin-bottom: 20px;
}

form#survey-form input,
form#survey-form textarea,
form#survey-form select {
    width: 100%;
    height: 40px;
    font-size: 1.1rem;
    padding: 0 10px;
    color: black;
    margin-top: 10px;
    border: none;
    border-radius: 5px;
}

form#survey-form select option {
    color: black;
}
form#survey-form .radio-group label {
    font-size: 1.3em;
    display: flex;
    align-items: center;
}
form#survey-form .radio-group label:not(:first-child) {
    margin-top: -25px;
}
form#survey-form .radio-group input {
    width: 1rem;
    margin-top: 0;
    margin-right: 10px;
}
form#survey-form .checkbox label {
    font-size: 1.3em;
    display: flex;
    align-items: center;
}
form#survey-form .checkbox label:not(:first-child) {
    margin-top: -25px;
}
form#survey-form .checkbox input {
    width: 1rem;
    margin-top: 0;
    margin-right: 10px;
}
form#survey-form textarea {
    height: 150px;
    border: none;
    padding: 10px;
}
form#survey-form button#submit {
    width: 100%;
    height: 50px;
    border-radius: 5px;
    border: none;
    /* color: black; */
    font-size: 1.5rem;
    font-weight: bold;
    background-color: rgb(0, 93, 0);
    transition: 0.1s;
    cursor: pointer;
}
form#survey-form button#submit:hover {
    background-color: rgb(246, 195, 195);
    color: black;
}

@media screen and (max-width: 520px) {
    body {
        padding: 50px 0;
    }
    h1#title {
        font-size: 2rem;
    }
    
    p#description {
        font-size: 1.1rem;
    }
    form#survey-form {
        border-radius: 0;
    }
    
}
              
            
!

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