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. 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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <html>
  <head>
    <title>course week2: HTML elements</title>
  </head>
  <body>
    <p>
      <img src="http://ctu-ict.net/wp/wp-content/uploads/2015/10/html-css.png" width="20%" id="layer"/>
      <em>Source of image: ctu-ict.net</em>
    </p>
    <p>Hello World!</p>
    
    <p>
      This webpage is a summary of <b> HTML elements </b>. It is created by HTML and CSS using the editor <a href="codepen.io"> codepen.io</a>.
    
    <h2> My first try...</h2>
    
    <p>
      <b> Try bold. </b>
      <em> Emphasize text. </em> 
    </p>
    <p>
      <b>This</b> <em> is an <b>example of nested</b> tags. </em>
    </p>
    
    <h2> Review: different types of HTML elements</h2>
    <h3>Summary</h3>
    <ul>
      <li>Basic elements, metadata elements
        <ul>
          <li class="element_example">html</li>
          <li class="element_example">head</li>
          <li class="element_example">title</li>
        </ul>
      </li>
      <li>Sectioning elements
        <ul>
          <li class="element_example">body</li>
          <li class="element_example">h1</li>
          <li class="element_example">h2</li>
        </ul>
      </li>
      <li>Semantic or style HTML
        <ul>
          <li class="element_example">b</li>
          <li class="element_example">em</li>
        </ul>
      </li>
      <li>Image and multimedia tags
        <ul>
          <li class="element_example">img src=" https://... " width="..."</li>
        </ul>
      </li>
      <li>Anchor tag for creating a link
        <ul>
          <li class="element_example">a href</li>
        </ul>
      </li>
    </ul>
    <h3> Additional resources? </h3>
    
    <p>
      Mozilla provides
      <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element"> 
        HTML element reference
      </a>.
    </p>
    <h3>More information</h3>
     <p>
      I leant these <b> basic elements of HTML </b> above from the week 2 materials of the online course
      <a href="https://www.coursera.org/learn/duke-programming-web/"><em>Programming and the Web for Beginners</em></a> provided by Duke University on Coursera. 
    </p>
    <p>
      From this course, I also learnt how to create a webpage using HTML and CSS. I've been hoping to make my own webpages for several years. I'm glad that I finally get it started.
    <p> This course is the first course of the specialization <em>Java Programming</em>. <b>The table below</b> shows the five courses of this specialization.
    </p>
    
    <table>
      <tr>
        <th> No.</th>
        <th><b>Java Programming: An Introduction to Software Specialization</b></th>
      </tr>
      <tr>
        <td> Course 1</td>
        <td> Programming and the Web for Beginners</td>
      <tr>
        <td> Course 2</td>
        <td> Java Programming: Solving Problems with Software</td>
      </tr>      
      <tr>
        <td> Course 3</td>
        <td> Java Programming: Arrays, Lists, and Structured Data</td>
      </tr>      
      <tr>
        <td> Course 4</td>
        <td> Java Programming: Principles of Software Design</td>
      </tr>
      <tr>
        <td> Course 5</td>
        <td> Java Programming: A DIY Version of Netflix and Amazon Recommendation Engines</td>
      </tr>      
    </table>
    
  </body>
</html>
              
            
!

CSS

              
                body {
  background-color: rgba(230, 227, 65, 0.3);
}

a {
  color: darkcyan;
}

table {
  border-color: rgba(22, 22, 3, 0.3);
}

#layer {
  float: left;
}

h3 {
  text-decoration: underline;
  color: #CD5C5C;
}

.element_example {
  color: green;
}

table,th {
  border: 2px solid slategrey;
}

td {
  border: 1px solid slategrey;
  background-color: #C8E0F7;
}

table {
  border-collapse:collapse;
  font-family:Helvetica;
}

th {
  text-align: left;
  background-color:#180D67;
  color: white;
}
              
            
!

JS

              
                
              
            
!
999px

Console