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

              
                <section class="hero">
  <img src="https://i.ibb.co/dr7Gsgf/Logo.png" alt="Courses Logo">
  <h1>Welcome to Code Courses</h1>
  <h2>Learn Coding Through Hands-On Practice</h2>
  <p>Code Courses helps you become a proficient developer with structured lessons, interactive coding exercises, and real-world projects. Start your journey today!</p>
  <a href="#" aria-label="Get Started with Code Courses">Get Started</a>
</section>
              
            
!

CSS

              
                /* Font styling */
@import url("https://fonts.googleapis.com/css2?family=Andika&family=Heebo:wght@800&family=Yantramanav&display=swap");
/* Reset default styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body styles */
body {
  background-color: #f4f4f4; /* Neutral earthy background */
  font-family: "Andika", sans-serif;
  color: #333; /* General text color */
}

/* Style the hero section */
.hero {
  background-color: #f5f5f5; /* Subdued earthy tone for the background */
  text-align: center; /* Center all text content */
  padding: 50px 20px; /* Add space around the content */
  position: relative; /* Establish positioning context for children */
}

/* Style the hero image */
.hero img {
  display: block;
  margin: 0 auto;
  width: 150px; /* Small image size */
  height: auto; /* Maintain aspect ratio */
  border-radius: 50%; /* Make the image circular */
  padding: 10px; /* Adds breathing room */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Soft shadow for depth */
  margin-bottom: 20px; /* Space below the image */
}

/* Style the main heading */
.hero h1 {
  font-size: 2.5em; /* Large font size for prominence */
  font-family: "Heebo", serif, sans-serif;
  color: #4b8a29; /* Slightly darker gray for contrast */
  margin-bottom: 10px; /* Space between heading and subheading */
}

/* Style the subheading */
.hero h2 {
  font-size: 1.5em; /* Medium font size for hierarchy */
  font-family: "Yantramanav", serif, sans-serif;
  color: #6a6a6a; /* Medium gray for distinction */
  margin-bottom: 20px; /* Space between subheading and description */
}

/* Style the description paragraph */
.hero p {
  font-size: 1em; /* Standard font size for readability */
  line-height: 1.6; /* Increase line spacing for clarity */
  margin: 0 2em 1.5em; /* Space between paragraph and button */
  color: #555; /* Softer gray for better contrast */
}

/* Style the call-to-action button */
.hero a {
  display: inline-block; /* Make the link look like a button */
  font-family: "Yantramanav", serif, sans-serif;
  text-decoration: none; /* Remove underline from link */
  color: #fff; /* White text for contrast */
  background-color: #4b8a29; /* Earthy green for a natural feel */
  padding: 12px 35px; /* Add space inside the button */
  border-radius: 25px; /* Rounded corners for a modern look */
  font-size: 1.2em; /* Standard font size for consistency */
  transition: background-color 0.3s ease, transform 0.3s ease; /* Smooth hover effect */
}

/* Add hover effect for the button */
.hero a:hover {
  background-color: #3e7321; /* Slightly darker green for interaction feedback */
  transform: scale(1.05); /* Subtle scaling effect */
}

/* Responsive design for mobile and desktop */
@media (max-width: 768px) {
  .hero {
    padding: 30px 15px; /* Reduce padding for smaller screens */
  }

  .hero h1 {
    font-size: 2em; /* Smaller font size for mobile */
  }

  .hero h2 {
    font-size: 1.2em; /* Smaller font size for mobile */
  }

  .hero p {
    font-size: 0.9em; /* Adjust paragraph size for readability */
    margin: 0 1em 1.5em; /* Reduce side margins */
  }

  .hero a {
    font-size: 1em; /* Slightly smaller font size */
    padding: 10px 20px; /* Adjust button size */
  }

  .hero img {
    width: 80px; /* Smaller image size for mobile */
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console