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

              
                <header id="header" class="hero">
  <div class="header-heading">
    <h2>Art Direction</h2>
  </div>
</header>

<main id="main">
  <article>
    <section>
      <h1>How to use Art Direction for Responsive Images</h1>
    </section>

    <section id="intro">
      <div class="flex-container clearfix">
        <div class="column-half">
        <p>
          What is art direction and how do you use it?
        </p>
        </div>
      </div>
    </section>
  </article>
</main>

<footer>
  <section>
    <div class="flex-container clearfix">
      <p><a href="https://caughtmyeye.cc">caught my eye</a>
    </div>
  </section>
</footer>
              
            
!

CSS

              
                /* || Default Formatting */

* {
  box-sizing: border-box;
}

/* Variables */

:root {
  --dt-padding: 30px;
  --mob-padding: 2%;
  --p-margin: 0 0 1em 0;
  --dark-colour: black;
  --light-colour: white;
  --footer-colour: #F05E35; /* Deep Orange */
  --debug-border: none; /* 1px solid white; */
  --no-border: none;
}

/* || Normalise */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

html {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

/**
 * Remove the margin in all browsers.
 */

body {
  font-size: 18px;
  margin: 0;
  background: var(--dark-colour);
  color: var(--light-colour);
}

main, footer {
  text-align: center;
  padding: var(--mob-padding); /* Mobile First */
  font: 1rem Helvetica Neue Light, Helvetica, Arial, sans-serif;
}

main p {
  font-size: 18px;
  text-align: left;
  margin: var(--p-margin);
}

#intro p {
  text-align: center;
}

header h1, header h2 {
  font-family: Courier;
  font-weight: normal;
}

main h1,
main h2 {
  font-weight: 100;
}

header h2 {
  font-size: 5rem;
}

h1 {
  font-size: 2rem;
}

.header-heading {
  padding: 12rem 0 0 5rem;
}

/**
 * || Media Queries for the Heading Overlay 
 *
 * Not mobile first ATM.
 */

@media screen and (max-width: 524px) {
  header h2 {
    font-size: 4rem;
  }
  .header-heading {
    padding: 13rem 0 0 2rem;
  }
}

@media screen and (max-width: 400px) {
  header h2 {
    font-size: 3.5rem;
  }
  .header-heading {
    padding: 14rem 0 0 1rem;
  }
}

@media screen and (max-width: 524px) {
  header h2 {
    font-size: 4rem;
  }
}

@media screen and (max-width: 400px) {
  header h2 {
    font-size: 3.5rem;
  }
}

.flex-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-container {
  display: grid;
  /* Rows / Columns */
  grid-template: 1fr auto 1fr / repeat(4, 1fr);
  gap: 3px;
  /*
  width: 45vw;
  border: 1.5px solid var(--light-colour);
  */
}

.grid-container .grid-item {
  border: 1.5px solid var(--light-colour);
  text-align: center;
  padding: 0.5rem;
  border: var(--debug-border);
}

/* || Fallback if no flexbox support. */
.clearfix:after {
  content: "";
  display: table;
  clear: both;
}

.column-full {
  float: none;
  width: 100%;
  border: var(--debug-border);
}

.column-half {
  float: left;
  width: 50%;
  border: var(--debug-border);

}

.column-third {
  float: left;
  width: 33.333%;
  border: var(--debug-border);
}

a, footer a {
  color: var(--footer-colour);
  text-decoration: none;
}

main a {
  border-bottom: 2px solid;
  line-height: 1.45;
}

header {
  min-height: 768px;
}

/* || Media Queries */

/** 
 * Kick in desktop sizing only when needed. 
 * 667px is iPhone 6 landscape width. 
 */
@media screen and (min-width: 667px) {
  main {
    padding: var(--dt-padding);
  }
}

/* End Default Formatting */

/* 
 * || Responsive Web Design Demo (formerly using Fusion Slider)
 *
 * mark l chaves 24 July 2019 (updated 9 September 3019)
 */

/* Mobile first responsive web design. */
.hero {
    background-image: url('https://marklchaves.files.wordpress.com/2020/02/test2slider-mob-768.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

/* Mobile landscape breakpoint. */
@media only screen and (min-width: 480px) {
    .hero {
        background-image: url('https://marklchaves.files.wordpress.com/2020/02/test2slider-land-768.jpg');
    }
}

/* Tablet breakpoint. */
@media only screen and (min-width: 768px) {
    .hero {
        background-image: url('https://marklchaves.files.wordpress.com/2020/02/test2slider-tab-768.jpg');
    }
}

/* Laptop breakpoint. */
@media only screen and (min-width: 1024px) {
    .hero {
        background-image: url('https://marklchaves.files.wordpress.com/2020/02/test2slider-lt-768.jpg');
    }
}

/* Desktop breakpoint. */
@media only screen and (min-width: 1600px) {
    .hero {
        background-image: url('https://marklchaves.files.wordpress.com/2020/02/test2slider-dt-768.jpg');
    }
}

#main {
  padding: 0 0 !important;
  margin: 0 0 !important;
}
              
            
!

JS

              
                
              
            
!
999px

Console