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>
	<h1 id="title">Erasmus student survey form</h1>
	<p id="description">Thank you for choosing Latvia as your Erasmus exchange studies country and capital city Riga as your place to stay!</p>
	<form id="survey-form">
		<div class="form-group">
			<label for="name" id="name-label">Name</label>
			<input type="text" id="name" name="name" placeholder="Enter your first name here" required>
			<label for="email" id="email-label">Email</label>
			<input type="email" id="email" name="email" placeholder="Enter your email here" required>
			<label for="number" id="number-label">Age (optional)</label>
			<input type="number" id="number" name="number" min="18" max="85" placeholder="Enter your age here" required>
		</div>
		<div class="form-group">
			<p>Select your university from the menu below</p>
				<select id="dropdown" name="higher-education" required size="1">
  					<option value="">LU</option>
  					<option value="rtu">RTU</option>
  					<option value="llu">LLU</option>
					<option value="rsu">RSU</option>
					<option value="lka">LKA</option>
					<option value="lkk">LKK</option>
					<option value="lma">LMA</option>
					<option value="jvlma">JVLMA</option>
					<option value="lspa">LSPA</option>
					<option value="lja">LJA</option>
					<option value="ba">BA</option>
					<option value="lnaa">LNAA</option>  
				</select> 
		</div>
		<div id="form-group-radio">
			<p>Will you attend the first welcoming party?</p>
			<label>Yes<input type="radio" id="yes" class="input" name="decision" value="yes" checked></label>
  			<label>No<input type="radio" id="no" class="input" name="decision" value="no"></label>
  			<label>Don't know...<input type="radio" id="not_know" class="input" name="decision" value="?"></label>
		</div>
		<div id="form-group-checkbox">
			<p>What are your plans, while staying this semester in Latvia?</p>
			<label>Make friends<input value="make-friends" id="friends" class="input" type="checkbox"/></label>
			<label>Explore the city<input value="explore" id="explore" class="input" type="checkbox"/></label>
			<label>Party<input value="party" id="party" class="input" type="checkbox"/></label>
			<label>Learn the native language<input value="learn-native" id="learn" class="input" type="checkbox"/></label>
		</div>
		<div id="form-group-comment">
			<p>Got something to say?</p>
			<textarea id="comments" name="comments" placeholder="Enter your comment here..."></textarea>
			<button type="submit" id="submit">Submit</button>
		</div>
	</form>
	<!-- Test checker is added at the bottom of page for faster page loading spped -->
	<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
</body>

              
            
!

CSS

              
                /*
	Author: Uga Sprogis
	Creation date: 29.01.2020
	Styling for the index.html file
*/


//One mixin was made for desktop users since overally the design looks good on all devices
@mixin for-desktop {
	@media (min-width: 600px) { @content; }
}

//The styling is made according to the html starting from top to bottom. 

body {
    background-image: url("https://static.officeholidays.com/images/935x475t/latvia-milda-01.jpg");
    background-size: cover;
    object-fit: fill;

    h1 {
        text-align: center;
        font-family: 'Roboto', sans-serif;
    }

    #description,
    p {
        text-align: center;                    
        font-family: Arial, Helvetica, sans-serif;
    }

    #survey-form {
        background-color: white;
        opacity: 80%;
        margin-left: 20%;
        margin-right:20%;
        width: 60%;
        padding-top: 30px;
        border: 4px;
        z-index: 10;

        .form-group {
            padding-bottom: 10px;
        }

        #dropdown,
        label,
        input {
            line-height: 2.5;
            margin-left: 10%;
        }

        #dropdown,
        input {
            padding-top: 10px;
            padding-bottom: 10px;
            box-sizing: border-box;
            width: 80%;
        }

        #form-group-radio {
        label {
            display: block;
            margin-left: 10%;
            width: 50%;
            height: auto;
            margin-right: 10%;
            line-height: 2.5;

            @include for-desktop {
                margin-left: 26%;
            }
        }
        input {
            display: block;
            width: 5%;
            float: right;
            margin-right: 30%;

            @include for-desktop {
                margin-right: 10%;
            }
        }
        }

        #form-group-checkbox { 
        label {
            display: block;
            margin-top: 20px;
            margin-left: 25%;
            width: 50%;
            height: auto;
            margin-right: 10%;
            line-height: 2.5;
        }
        input {
            display: block;
            width: 5%;
            float: right;   
            margin-right: 10%;
        }
        }

        #comments {
            margin-left: 10%;
            margin-right: 10%;
            width: 80%;
            height: 200px;
        }

        textarea::placeholder {
            font-size: 20px;
            color: black;            
        }

        #submit {
            font-weight: bold;
            color: black;
            background-color: #008000;
            width: 40%;
            height: 50px;
            margin: 20px 30%;
            z-index: 5;
            cursor: pointer;
        }

    }
}
              
            
!

JS

              
                
              
            
!
999px

Console