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

              
                <header>
    <h1>Welcome to My Website</h1>
    <nav>
        <a href="#">Home</a>
        <a href="#">About Us</a>
        <a href="#">Services</a>
        <a href="#">Contact</a>
    </nav>
    <a class="phone" href="tel:5555555555">Call Us: 555-555-5555</a>
</header>
<main>
    <h2>Contact Us</h2>
    <p>We'd love to hear from you! Reach out to us using the information below:</p>
    <p>
        <strong>Phone:</strong> 
        <a class="prominent-phone" href="tel:5555555555">555-555-5555</a>
    </p>
    <p>
        <strong>Email:</strong> 
        <a href="mailto:info@mywebsite.com">info@mywebsite.com</a>
    </p>
    <p>
        <strong>Address:</strong> 
        123 Fake Street, Faketown, FK1 2AB
    </p>
    <p>
        <strong>Follow us on:</strong>
        <a href="#">Facebook</a>,
        <a href="#">Twitter</a>,
        <a href="#">Instagram</a>
    </p>
    <h3>Contact Form</h3>
    <form>
        <label for="name">Name:</label><br>
        <input type="text" id="name" name="name" placeholder="Your name"><br>
        <label for="email">Email:</label><br>
        <input type="email" id="email" name="email" placeholder="Your email"><br>
        <label for="message">Message:</label><br>
        <textarea id="message" name="message" rows="4" placeholder="Your message"></textarea><br>
        <input type="submit" value="Submit">
    </form>
</main>
<footer>
    <div class="footer-content">
        <p>&copy; 2024 My Website</p>
        <p>Email: <a href="mailto:info@mywebsite.com">info@mywebsite.com</a></p>
        <p>Address: 123 Fake Street, Faketown, FK1 2AB</p>
    </div>
    <div class="footer-content">
        <p>Follow us on:
            <a href="#">Facebook</a>,
            <a href="#">Twitter</a>,
            <a href="#">Instagram</a>
        </p>
        <a href="tel:5555555555">Contact Us: 555-555-5555</a>
    </div>
</footer>

              
            
!

CSS

              
                body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header, footer {
    background-color: #fa8072; /* Salmon color */
    color: #ffffff;
    padding: 10px 20px; /* Smaller header and footer */
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

header nav a, header a.phone, footer a {
    display: inline-block;
    margin: 0 10px;
    color: #ffffff;
    text-decoration: none;
}

header nav a:hover, header a.phone:hover, footer a:hover, main a.prominent-phone:hover {
    text-decoration: underline;
}

header nav {
    margin-bottom: 10px;
}

header a.phone {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #ffffff;
}

main {
    flex: 1;
    padding: 20px;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

main form {
    margin-top: 20px;
}

main form label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

main form input[type="text"],
main form input[type="email"],
main form textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

main form input[type="submit"] {
    background-color: #fa8072;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

main form input[type="submit"]:hover {
    background-color: #e76e61;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    width: 100%;
    box-sizing: border-box;
}

footer .footer-content {
    flex: 1;
    text-align: left;
}

footer .footer-content:last-child {
    text-align: right;
}
              
            
!

JS

              
                
              
            
!
999px

Console