cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <h1>Intro to front-end web development</h1>
<div class="columns">
  <article>
    <h2>What is HTML?</h2>
    <p>
      <a href="https://www.w3.org/TR/html5">HTML</a> is the language used to create the web pages you visit everyday. It provides a logical way to structure content for web pages.
    </p>
    <p>
      Let's analyze the acronym "HTML", as it contains a lot of useful information. HTML stands for HyperText Markup Language.
    </p>
    <p>
      A markup language is a computer language that defines the structure and presentation of raw text. Markup languages work by surrounding raw text with information the computer can interpret, "marking it up" for processing.
    </p>
    <p>
      HyperText is text displayed on a computer or device that provides access to other text through links, also known as "hyperlinks".
    </p>
  </article>
  <article>
    <h2>What is CSS?</h2>
    <p>
      CSS, or Cascading Style Sheets, is a language that web developers use to style the HTML content on a web page. If you're interested in modifying colors, font types, font sizes, shadows, images, element positioning, and more, CSS is the tool for the job!
    </p>
    <img src="https://c1.staticflickr.com/1/537/32398153402_2a7028b2bd_z.jpg" alt="A drawing of an empty browser window">
    <p>
      Although the <code>&lt;style&gt;</code> element allows you to write CSS code within HTML files, this mixture of HTML and CSS can result in code that is difficult to read and maintain.
    </p>
    <p>
      It's common for developers to add substantial amounts of custom CSS styling to a web page. When all of that CSS code is placed within a &lt;style&gt; element in an HTML file, you risk the following two things:
    </p>
    <ol>
      <li>Creating a large HTML file that is difficult to read and maintain (by you and other developers). Overall, this can result in an inefficient workflow.</li>
      <li>Maintaining a clear distinction between web page structure (HTML) and web page styling (CSS).</li>
    </ol>
    <p>
      Fortunately, the following solution will help you avoid creating large HTML files that mix in CSS code: a CSS file!
    </p>
    <p>
      HTML files are meant to contain only HTML code. Similarly, CSS files are meant to contain only CSS code. You can create a CSS file by using the .css file name extension, like so: style.css
    </p>
    <p>
      With a CSS file, you can write all the CSS code needed to style a page without having to sacrifice the readability and maintainability of your HTML file.
    </p>
  </article>
</div>
            
          
!
            
              /* Defaults */
body {
  font-family: Helvetica, sans-serif;
  font-size: 1em;
  line-height: 1.5;
  background-color: rgb(95,121,149);
  color: rgb(0,0,0);
  margin: 0;
  padding: 1.5em;
}

/* Typography */
h1 {
  font-size: 7.5vw;
  text-align: center;
  margin: 0 0 1.5rem 0;
  padding: 1.5rem;
  background-color: rgb(255,255,255);
}

h2 {
  font-size: 1.5rem;
  text-transform: uppercase;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

h1, h2 {
  font-family: Palatino, serif;
}

p {
  padding: 0;
  margin: 0 0 1.5rem 0;
}

ol {
  padding: 0 0 0 3rem;
  margin: 0 0 1.5rem 0;
}

/* Layout */
article {
  padding: 1.5rem;
  margin: 0 0 1.5rem 0;
  background-color: rgb(255,255,255);
}

img {
  max-width: 100%;
  height: auto;
}

/* Responsive web design */
@media screen and (min-width: 600px) {
  body {
    padding: 3em;
    max-width: 60em;
    margin: 0 auto;
  }

  h1 {
    margin: 0 0 3rem 0;
  }

  article {
    margin: 0 0 3rem 0;
  }

  .columns {
    display: flex;
  }
}

            
          
!
999px
Loading ..................

Console