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

              
                <div id="main">

  <div id="tribute-info">
    <h2>Overview</h2>
    <p>Porto, which is Portugal's second largest city, is situated along the Douro River near its confluence with the Atlantic Ocean.  The city is known for its working-class ethos, but has increasingly become a magnet for gastronomes and sightseers.  The historical center of Porto was designated a UNESCO World Heritage site in 1996.</p>

    <h2>Sights</h2>
    <p>These are some of the popular destinations to visit in Porto: </p>
      <ul>
        <li>
          <a href="https://www.tasteporto.com/port-wine-cellars-you-cant-miss-in-porto/" id="tribute-link" target="_blank">Port Wine Lodges</a>
        </li>
        <li>
          <a href="https://www.livrarialello.pt/en-us/" id="tribute-link" target="_blank">Livraria Lello</a>
        </li>
        <li>
          <a href="https://en.wikipedia.org/wiki/S%C3%A3o_Bento_railway_station" id="tribute-link" target="_blank">Sao Bento train station</a>
        </li>
      </ul>
    <h2>Food</h2>
    <p>Porto is famous for the following dishes:
      <ul>
        <li>
          <a href="https://en.wikipedia.org/wiki/Francesinha" id="tribute-link" target="_blank">Francesinha</a>
        </li>
        <li>
          <a href="https://explorepartsunknown.com/porto/recipe-tripas-a-moda-do-porto/" id="tribute-link" target=_blank>Tripas &#0224; Moda do Porto</a>
        </li>
      </ul>
    </p>
    <p>For more information, please visit <a href="https://en.wikipedia.org/wiki/Porto" id="tribute-link" target="_blank">Porto's Wikipedia page</a>.</p>
  </div>

  <div id="img-div">
    <img src="https://images.unsplash.com/photo-1520501987919-fffee430f416?ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80" alt="" id="image" />
    <div id="title">
      <h1>Porto</h1>
      <h4>Second City of Portugal</h4>
    </div>
    <div id="img-caption">
      <figcaption class="caption">Evening lights reflecting in the Douro River</figcaption>
      <figcaption class="caption-photo-credit">Photo by Pier Francesco Grizi on Unsplash</figcaption>
    </div>
  </div>

  <footer id="footer">
    <p>Copyright 2019 by Keith Stubbs</p>
  </footer>

</div>
              
            
!

CSS

              
                body {
  margin: 0;
  padding: 0;
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  font-weight: 400;
  background-color: #B8DBD9;
  color: #443850;
}

#main {
  display: flex;
  flex-flow: row wrap;
  text-align: center;
  align-items: center;
}

h1 {
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: .25em;
  font-size: calc(6vw + 1.5rem);
}

#tribute-info {
  text-align: justify;
  padding: 2em;
  min-width: 300px;
  flex: 2 300px;
  order: 2;
  font-size: 1em;
}

#tribute-info h2 {
  font-size: 1.2em;
  margin-top: 0;
  padding: 0.5em 0;
}

#tribute-link {
  color: darkblue;
  font-weight: bolder;
  text-decoration: none;
}

#tribute-link:hover {
  text-decoration: underline;
}

#tribute-link:visited {
  color: darkblue;
}

#img-div {
  text-align: center;
  order: 1;
}

#title {
  color: white;
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translate(-50%, -50%);
}

@media screen and (min-width: 601px) {
  #title {
    left: 50%;
    top: 20%;
    transform: translate(-50%, -50%);
  }
}

@media screen and (max-width: 600px) {
  #title {
    left: 50%;
    top: 10%;
    transform: translate(-50%, -50%);
  }
}

#title h4 {
  font-weight: lighter;
  margin-top: 0;
  font-size: calc(1vw + .5rem);
}

#image {
  display: block;
  max-width: 100%;
}

#img-caption {
  padding-top: .5em;
}

.caption {
  font-size: .8em;
}

.caption-photo-credit {
  font-size: .65em;
  font-style: italic;
}

#footer {
  flex: 0 100%;
  order: 3;
}

#footer p {
  font-size: .6em;
}

              
            
!

JS

              
                // coded by @ChaituVR
const projectName = 'tribute-page';
localStorage.setItem('example_project', 'Tribute Page');
              
            
!
999px

Console