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.
<body>
<!--Begin Form-->
<header class="header">
<h2>Roget Freelancing</h2>
<h3>Responsive Design Contact Form</h3>
</header>
<div class="container">
<form class="contact" action="/action_page.php" method="post">
<h4>Contact Form</h4>
<h5>Interested? Contact Roget Freelancing today! </h5>
<fieldset> <!--Begin First Name-->
<input placeholder="First Name" type="text" tabindex="1" required autofocus>
</fieldset><!-- End First Name-->
<fieldset><!--Begin Last Name-->
<input placeholder="Last Name" type="text" tabindex="2" required autofocus>
</fieldset>
<!-- End Last Name-->
<!--Begin Email-->
<fieldset>
<input placeholder="Your Email Address" type="email" tabindex="3" required>
</fieldset>
<!-- End Email-->
<!--Begin Country-->
<fieldset>
<select id="country" name="country" tabindex="4">
<option selected>Select Country:</option>
<option value="1">Australia</option>
<option value="2">United Kingdom</option>
<option value="3">United States of America</option>
</select>
</fieldset>
<!--End Country-->
<!--Begin State-->
<fieldset>
<select id="state" name="state" class="state" tabindex="5">
<option selected>Select State or Territory:</option>
<option value="1">Alabama</option>
<option value="2">Alaska</option>
<option value="3">Arizona</option>
<option value="4">Arkansas</option>
<option value="5">California</option>
<option value="6">Colorado</option>
<option value="7">Connecticut</option>
<option value="8">Delaware</option>
<option value="9">Florida</option>
<option value="10">Georgia</option>
<option value="11">Hawaii</option>
<option value="12">Idaho</option>
<option value="13">Illinois</option>
<option value="14">Indiana</option>
<option value="15">Iowa</option>
<option value="16">Kansas</option>
<option value="17">Kentucky</option>
<option value="18">Louisiana</option>
<option value="19">Maine</option>
<option value="20">Maryland</option>
<option value="21">Massachusetts</option>
<option value="22">Michigan</option>
<option value="23">Minnesota</option>
<option value="24">Mississippi</option>
<option value="25">Missouri</option>
<option value="26">Montana</option>
<option value="27">Nebraska</option>
<option value="28">Nevada</option>
<option value="29">New Hampshire</option>
<option value="30">New Jersey</option>
<option value="31">New Mexico</option>
<option value="32">New York</option>
<option value="33">North Carolina</option>
<option value="34">North Dakota</option>
<option value="35">Ohio</option>
<option value="36">Oklahoma</option>
<option value="37">Oregon</option>
<option value="38">Pennsylvania</option>
<option value="39">Rhode Island</option>
<option value="40">South Carolina</option>
<option value="41">South Dakota</option>
<option value="42">Tennessee</option>
<option value="43">Texas</option>
<option value="44">Utah</option>
<option value="45">Vermont</option>
<option value="46">Virginia</option>
<option value="47">Washington</option>
<option value="48">West Virginia</option>
<option value="49">Wisconsin</option>
<option value="50">Wyoming</option>
<option value="51">District of Columbia</option>
<option value="52">American Samoa</option>
<option value="53">Guam</option>
<option value="54">North Mariana Islands</option>
<option value="55">Puerto Rico</option>
<option value="56">U.S. Virgin Islands</option>
</select>
</fieldset><!--End States-->
<fieldset>
<input placeholder="Message Subject" type="text" tabindex="6">
</fieldset>
<fieldset>
<textarea placeholder="Type your message here..." name="subject" tabindex="7" required></textarea>
</fieldset>
<!--End State-->
<!--Begin Submit Button-->
<fieldset>
<button name="submit" type="submit" id="submit" data-submit="...Sending">Submit</button>
</fieldset>
<!--End Submit Button-->
</form>
</div>
</body>
/* font-family: 'Lato', sans-serif;
font-family: 'Irish Grover', cursive; #ffbe00 c9d6df 00bbf0 0960bd 393e46 */
@import url('https://fonts.googleapis.com/css?family=Irish+Grover|Lato:400,700,700i');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
html {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/1148131/fabric-1100790_1920.jpg);
}
body {
background: transparent;
font-family: 'Lato', sans-serif;
padding: 10px;
margin: 0;
line-height: 30px;
}
header {
background: rgba(255, 255, 255, 0.7);
max-width: 550px;
width: 100%;
margin: 0 auto;
margin-top: 20px;
padding: 20px;
border-radius: 40px;
position: relative;
}
header h2 {
display: block;
color: black;
font-family: 'Irish Grover', cursive;
font-size: 2em;
font-weight: 700;
text-align: center;
}
header h3 {
display: block;
black: color;
font-family: 'Lato', sans-serif;
font-size: 1.5em;
font-weight: 700;
text-align: center;
}
.container {
max-width: 600px;
width: 100%;
margin: 0 auto;
position: relative;
}
form {
background-color: #ffbe00;
padding: 40px;
margin: 50px 0;
border-radius: 40px;
}
.contact h4 {
display: block;
font-family: 'Irish Grover', cursive;
font-size: 2em;
text-transform: uppercase;
font-weight: 700;
text-align: center;
}
.contact h5 {
display: block;
font-family: 'Lato', sans-serif;
font-weight: 400;
font-size: 1em;
text-align: center;
text-transform: none;
}
/* Style for Form */
fieldset {
border: ;
margin: 0 0 10px;
min-width: 100%;
padding: 0;
width: 100%;
}
.contact input[type="text"], .contact input[type="email"],
.contact select, .contact textarea{
width: 100%;
border: 1px solid black;
background: #c9d6df;
margin: 0 0 5px;
padding: 10px;
font-size: .80em;
}
.contact input[type="text"]:hover, .contact input[type="email"]:hover,
.contact select:hover, .contact textarea:hover{
-webkit-transition:border-color 0.3s ease-in-out;
-moz-transition: border-color 0.3s ease-in-out;
transition: border-color 0.3s ease-in-out;
border: 1px solid #00bbf0;
}
.contact textarea {
height: 100px;
max-width: 100%;
resize: none;
}
.contact button[type="submit"] {
cursor: pointer;
width: 100%;
border: none;
background: #00bbf0;
color: black;
margin: 0 0 5px;
padding: 10px;
font-size: 1em;
font-weight: 700;
}
.contact button[type="submit"]:hover {
background: #0960bd;
-webkit-transition:border-color 0.3s ease-in-out;
-moz-transition: border-color 0.3s ease-in-out;
transition: border-color 0.3s ease-in-out;
border: 1px solid #AAA;
}
.contact button[type="submit"]:active {
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}
.contact input:focus, .contact textarea:focus {
outline: 0;
border: 1px solid #999;
}
::-webkit-input-placeholder {
color: #393e46;
}
:-moz-input-placeholder {
color: #393e46;
}
::-moz-input-placeholder {
color: #393e46;
}
:-ms-input-placeholder {
color: #393e46;
}
$("form").submit(function(){
alert("Thank Your for Submitting your Form!");
});
Also see: Tab Triggers