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

              
                <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

<!DOCTYPE html>
<html>
  
  <div id="background">
    <img class="background_stretch" src="https://img.locationscout.net/images/2015-07/suncity-the-palace-of-the-lost-city-south-africa_l.jpeg" alt="Sun_City">
  </div>
  
  <div id="background_right">
    <img class="background_right_stretch" src="https://www.sabi-sands.com/assets/img/lion-sabi-sands-big-five-safari.jpg" alt="Lion">
  </div>
    
  <div class="header_text">
    <div class="header_title">
      <h1>South Africa</h1>
    </div>
    
    <div class="header_quote">
      <h2>
        <br>
        <br>"If ever magic has been seen,<br> its seen in South Africa"</h2>
    </div>
  </div>
        
        
    
    
  <main id=main-doc>
    
    <nav id="navbar">
      <header>Places to visit in South Africa</header>
      
      <ul>
        <li><a class="nav-link" href="#Pretoria">Pretoria</a></li>
        <li><a class="nav-link" href="#Johannesburg">Johannesburg</a></li>
        <li><a class="nav-link" href="#Durban">Durban</a></li>
        <li><a class="nav-link" href="#North_West_Province">North West Province</a></li>
        <li><a class="nav-link" href="#Cape_Town">Cape Town</a></li>
      </ul>
    </nav>
    
    <section class="main-section" id="Pretoria">
      <header>Pretoria</header>
      
      <p>
        <code>"Mholo Pretoria"</code>
      </p>
      <p>
        <ul>
          <li>Best time to visit:May-September</li>
          <li>Places to visit:</li>
          <ul>
            <li>Voortrekker Monument</li>
            <li>Union Buildings</li>
            <li>National Zoological Gardens of South Africa</li>
            <li>Church Square</li>
          </ul>
      </ul>
      </p>
    
    <section class="main-section" id="Johannesburg">
      <header>Johannesburg</header>
      
      <p>
        <code>"Howzit Johannesburg"</code>
      </p>
      <p>
        <ul>
          <li>Best time to visit:March-May</li>
          <li>Places to visit:</li>
          <ul>
            <li>Gold Reef City</li>
            <li>Mandelas House</li>
            <li>Cradle of Mankind</li>
            <li>Apartheid Museum</li>
          </ul>
      </ul>
      </p>
      
          <section class="main-section" id="Durban">
      <header>Durban</header>
            
            <p>
        <code>"Heita Durban"</code>
      </p>
      <p>
        <ul>
          <li>Best time to visit:April-September</li>
          <li>Places to visit:</li>
          <ul>
            <li>Umgeni River Bird Park</li>
            <li>uShaka Marine World</li>
            <li>Durban Botanic Gardens</li>
            <li>Golden Mile</li>
          </ul>
      </ul>
      </p>
            
            <section class="main-section" id="North_West_Province">
      <header>North West Province</header>
              
              <p>
        <code>"Sawubona North West Province"</code>
      </p>
      <p>
        <ul>
          <li>Best time to visit:August-March</li>
          <li>Places to visit:</li>
          <ul>
            <li>Sun City Resort</li>
            <li>Pilanesberg National Park</li>
            <li>Lion and Safari Park</li>
            <li>Hartbeespoort Dam</li>
          </ul>
      </ul>
      </p>
              
              <section class="main-section" id="Cape_Town">
      <header>Cape Town</header>
                
                        <p>
        <code>"Dumela Cape Town"</code>
      </p>
      <p>
        <ul>
          <li>Best time to visit:December-February</li>
          <li>Places to visit:</li>
          <ul>
            <li>Maclears Beacon</li>
            <li>Robben Island</li>
            <li>Cape of Good Hope</li>
            <li>V&A Waterfront</li>
          </ul>
      </ul>
      </p>
    
    
    
    
  </main>
</html>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap');

body{font-family:"poppin";
     color:white; 
     background-color: black;
     line-height:1.4;
  width: 100%;}

#background{position:absolute;
            width: 100%;
            height: auto;

            left:300px;
            top: 0px;
            z-index:-1;}

.background_stretch{width:100%;
                    height: auto;
                    opacity:  0.75;}

#background_right{position: absolute;
                  width: 100%;
                  height:auto;
                  
                  left:600px;
                  top:885px;
                  z-index: -1;}

.background_right_stretch{width:75%;
                          height:auto;
                          opacity: 0.75;}


.header_text{display:grid;
             grid-template-columns:1fr 1fr;
             grid-gap:50px;

             width:100%;
             height:auto;
             
             position:absolute;
             top: 18vw;
             left:0vw;
             z-index:2;}

.header_title{grid-column:1;
              grid-row:1;
              text-align:right;
              font-size:30px;
              color:silver;
              z-index:2;}

.header_quote{grid_column:2;
              grid-row:1;

              font-size:15px;
              color:silver;
              word-spacing:2px;
              letter-spacing:2px;
              z-index:2;}

#navbar header{color:black;
               margin:10px;
               text-align:center;
               font-size:1.8em;}

#navbar li{list-style:none;
           padding:5px 0px;
           position:relative; 
           width: 100%; }

#navbar a{color:grey;
          text-decoration: none;}

#navbar a:hover{color:black;
                text-decoration:underline;}



#navbar{position: fixed;
        height: 100%;
        min-width: 300px;
  width:300px;
  
  left:0px;
  top:0px;
  
  color: black;
  background-color:white;
  padding:75px 0px;}

#main-doc{position:absolute;
          top:30vw;
          margin-left:310px;
          padding:20px}

Section{background:rgb(230,255,255,0,1);
        padding:2.5rem 2.5rem;
        border-radius:2rem;
        width:500px;
        margin: auto;}

Section header{text-transform: uppercase;
               font-weight:bold;
               font-size:30px;
               letter-spacing:20px;}


@media(max-width:850px)
  #navbar{postion:absolute;
          max-height:300px;
          max-width:300px;
          width:300px;

          top:0px;
          left:0px;
      
          color:black;
          background-color:white;
          padding:75px 0px;
          z-index:1;}

.header_text{display:grid;
             grid-template-columns:1fr 1fr;
             grid-gap:50px;
             grid-auto-rows:minmax(100px,auto);
  
             width:100%;
             height:auto;
             position:absolute;
             top:18vw;
             left:300px;
  z-index:2;}

#main-doc{position:relative;
          margin-left:0px;
  margin-top:300px;} 
              
            
!

JS

              
                
              
            
!
999px

Console