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

              
                <!-- nav start -->
<nav>

  <label for="drop" class="toggle">&#8801; </label>
  <input type="checkbox" id="drop">

  <ul class="menu">
    <li class="logo">Buck Island</li>
    <li><a href="#">About <span>Buck Island</span></a></li>
    <li><a href="#">Location</a></li>
    <li><a href="#">Area <span>Information</span></a></li>
    <li><a href="#">Community <span>Information</span></a></li>
    <li><a href="#">Rentals</a></li>
    <li><a href="#">Contact <span>Us</span></a></li>
  </ul>
</nav>

<!-- hand written -->
<h1>Your family vacation destination</h1>

<!-- hand written end-->

<!-- nav end-->
<!-- main start -->
<div class="container">
  <header class="intro">
    <div class="panel">
      <img class="panel-image" src="https://forallthetime.com/CHAIR/IMAGES/SANY0432-300x225.jpg" alt="chair">
      <p>Welcome to Buck Island, a premiere family vacation destination community on the Outer Banks of North
        Carolina!

        Explore our community on these pages. We take great pride in our homes and community and welcome you to
        experience them. We are conveniently located near Corolla shopping and entertainment areas. We have
        sidewalks, light posts, numerous amenities and a wonderful beach area and with excellent services. You can
        arrive, park the car for a week, and have everything you need close by, for a perfect vacation!

        We hope after exploring what Buck Island offers, you’ll agree that we are your family vacation destination.
        See you soon!</p>
    </div>
  </header>
</div>
              
            
!

CSS

              
                /* index .css below */

:root {
  --color-light-blue: rgba(153, 176, 233, 1);
  --color-dark-blue: rgba(0, 151, 255, 1);
}

/* generic styles ----------------------------------- */
body {
  margin: 0;
  font-family: "Raleway", sans-serif;
  background: linear-gradient(
    45deg,
    rgba(153, 176, 233, 1) 35%,
    rgba(0, 151, 255, 1) 72%
  );
  min-height: 100vh;
}

header {
  padding: 10px;
}

h2 {
  font-size: 2em;
  margin-bottom: 1em;
}

p {
  margin-bottom: 1em;
}

figure {
  margin: 0;
  padding: 10px;
}

.figure-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info {
  padding: 40px;
  background-color: #547240;
  color: white;
}

.info-link {
  text-decoration: none;
  color: #ff9900;
}

/* grid styles ------------------------------------ */
.main {
  display: grid;
}

@media (min-width: 600px) {
  .main {
    grid-template-columns: repeat(6, 1fr);
  }

  .info--1 {
    grid-column: span 2;
    grid-row: span 2;
  }

  .info--2 {
    grid-column: span 2;
  }

  .figure1 {
    grid-column: span 3;
    grid-row: span 2;
  }
}

h1 {
  margin: 0.5em 0 0.5em;
  text-align: center;
  font-size: 4rem;
  line-height: 1.2;
}
#container {
  margin: 0 auto;
  max-width: 890px;
}

.toggle,
[id^="drop"] {
  display: none;
}

.logo {
  display: flex;
  justify-content: space-between;
  padding: 0 30px;
  color: white;
  font-size: 30px;
  font-family: "Playball", cursive;
  font-weight: 400;
  font-style: normal;
  margin-right: 10vw;
}
nav {
  display: flex;
  justify-content: end;
  background-color: #514fdb;
  font-size: 26px;
  font-family: "Lemon", serif;
  font-weight: 400;
  font-style: normal;
}
/* nav begin */
.menu {
  display: flex;
  align-items: center;
  flex: 1 0 0;
  justify-content: space-between;
  padding: 0 1rem 0 0;
  margin: 0;
  list-style: none;
  position: relative;
}

.menu a {
  display: block;
  padding: 5px;
  color: #fff;
  font-size: 1.1rem;
  line-height: 3;
  text-decoration: none;
}
.menu a:hover {
  background-color: #1417e6;
}

/* Media Queries
--------------------------------------------- */

@media screen and (max-width: 1495px) {
  .menu a {
    font-size: 0.9rem;
  }
}

@media screen and (max-width: 1200px) {
  .menu a span {
    display: none;
  }
}

@media all and (max-width: 800px) {
  nav a:hover {
    background-color: #1417e6;
  }
  nav {
    margin: 0;
  }
  .toggle + a,
  .menu {
    display: none;
  }

  .toggle {
    display: block;
    background-color: #3633cc;
    padding: 0 20px;
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    line-height: 60px;
    text-decoration: none;
    border: none;
  }

  .toggle:hover {
    background-color: #3633cc;
  }

  [id^="drop"]:checked + ul {
    display: block;
  }

  nav ul li {
    display: block;
    width: 100%;
  }

  nav ul ul .toggle,
  nav ul ul a {
    padding: 0 40px;
  }

  nav ul ul ul a {
    padding: 0 80px;
  }

  nav a:hover,
  nav ul ul ul a {
    background-color: #3633cc;
  }

  nav ul li ul li .toggle,
  nav ul ul a {
    background-color: #547240;
  }

  nav ul ul {
    float: none;
    position: static;
    color: #ffffff;
  }

  nav ul ul li:hover > ul,
  nav ul li:hover > ul {
    display: none;
  }

  nav ul ul li {
    display: block;
    width: 100%;
  }

  nav ul ul ul li {
    position: static;
  }
}

@media all and (max-width: 1393px) {
  nav ul li {
  }
}
/* nev end */

/** main start **/

/*

Forum question answer only : 

https://www.sitepoint.com/community/t/wonky-vs-code-and-codepen/436461/4*/

h1 {
  font-family: "Dancing Script", cursive;
  font-size: clamp(2rem, 10vw, 6rem);
  color: white;
}

html {
  box-sizing: border-box;
}
*,
*:before,
*:after {
  box-sizing: inherit;
}
html,
body {
  padding: 0;
  margin: 0;
}

.intro {
  display: flex;
  position: relative;
  background-size: cover;
  background-position: 50%;
  padding: 1rem;
}
.panel {
  padding: 1rem;
  max-width: 1fr;
  margin: auto;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2vw;
  box-shadow: 0px 5px 10px #cf77f3, 0px 5px 10px #009bff, 0px 5px 10px #2ac9db;
  border: 1px solid silver;
}

.intro h1 {
  margin: 0.8rem 1rem;
  font-size: clamp(2rem, 10vw, 4rem);
  color: white;
  text-align: center;
  text-shadow: 9px 1px rgba(0, 0, 0, 0.8);
}
p {
  font-size: clamp(1.5rem, 3vw, 3rem);
  margin: 0.8rem 1rem;
  text-shadow: 1px 1px rgba(0, 0, 0, 0.8);
  color: white;
}

@media screen and (max-width: 800px) {
  .panel {
    background: rgba(0, 0, 0, 0.1);
  }
}

.panel-image {
  max-width: 450px;
  min-width: 200px;
  width: 50%;
  height: auto;
  margin: 0 10px 10px 0;
  float: left;
}

              
            
!

JS

              
                /*

Sitepoint forum answer only:

https://www.sitepoint.com/community/t/break-point-issues/437744/8

Re: original :
https://forallthetime.com/CHAIR/index.html


*/

              
            
!
999px

Console