HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs 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 its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link href="style.css" rel="stylesheet"/>
<title>The Basic Language of the web: HTML</title>
</head>
<body>
<!-- <h1>The Basic Language of the web: HTML</h1>
<h2>The Basic Language of the web: HTML</h2>
<h3>The Basic Language of the web: HTML</h3>
<h4>The Basic Language of the web: HTML</h4>
<h5>The Basic Language of the web: HTML</h5>
<h6>The Basic Language of the web: HTML</h6>
-->
<div class="container">
<header class="main-header clearfix">
<h1>π The Code Magazine</h1>
<nav>
<!-- <strong>This is the navigation</strong> -->
<a href="https://codepen.io/bryanmax9/pen/NWXwYYQ">Blog</a>
<a href="#
" target="_blank">Challenges</a>
<a href="https://codepen.io/bryanmax9/pen/ExobELX?editors=0010">Flexbox</a>
<a href="https://codepen.io/bryanmax9/pen/yLpPKje">CSS Grid</a>
</nav>
<!-- <div class= "clear"></div> -->
</header>
<!-- Only necessary for flexbox -->
<!-- <div class="row"> -->
<article>
<header class="post-header">
<h2>The Basic Language of the web: HTML</h2>
<div class="author-box">
<img src="https://cdn.pixabay.com/photo/2016/07/20/21/03/tux-1531289_960_720.png" alt="Tux penguin profile picture" height="50" width="50" class="author-img" >
<p id="author" class="author"> Posted by <strong>Tux Coder</strong> on Monday, June 21st 2001</p>
</div>
<img src="https://cdn.searchenginejournal.com/wp-content/uploads/2020/12/9-html-tags-11-attributes-you-must-know-for-seo-5fca27dc748f4.png" alt="html code on a screen" width="500" height="200" class="post-img">
<button>πlike</button>
</header>
<p>
All modern websites and web applications are built using three
<em>fundamental</em>
technologies: HTML, CSS and JavaScript. These are the languages of the
web.
</p>
<p>
In this post, let's focus on HTML. We will learn what HTML is all about,
and why you too should learn it.
</p>
<h3>What is HTML?</h3>
<p>
HTML stands for <b>H</b>yper <b>T</b>ext <b>M</b>arkup <b>L</b>anguage.
It's a markup language that web developers use to structure and describe
the content of a webpage (not a programming language).
</p>
<p>
HTML consists of elements that describe different types of content:
paragraphs, links, headings, images, video, etc. Web browsers understand
HTML and render HTML code as websites.
</p>
<p>
In HTML, each element is made up of 3 parts:
<ol>
<li class="first-li">The opening tag</li>
<li>The closing tag</li>
<li>The actual element</li>
</ol>
<p>You can learn more at <a href="https://developer.mozilla.org/en-US/docs/Web/HTML" target="_blank"> MDN Web Docs</a></p>
</p>
<h3>Why should you learn HTML?</h3>
<p>There are countless reasons for learning the fundamental language of the web. Here are 5 of them:
<ul>
<li class="first-li">To be able to use the fundamental web dev language</li>
<li>To hand-craft beautiful websites instead of relying on tools like Worpress or Wix</li>
<li>To build web applications</li>
<li>To impress friends</li>
<li>To have fun π</li>
</ul>
<p> Hopefully you learned something new here. See you next time! </p>
</p>
</article>
<aside>
<h4><b>Related posts</b></h4>
<ul class="puntos">
<li class="related-post"><img src="https://f.hubspotusercontent00.net/hubfs/53/Google%20Drive%20Integration/How%20to%20Start%20Coding%20The%20Ultimate%20Guide%20for%20Beginner%20Programmers.jpeg" alt="Person writting in a computer" width="75">
<div>
<a href="shoestore.html" class="related-link">How to learn Web Development</a>
<p class="related-author">By Bryan Tineo</p>
</div>
</li>
<li class="related-post"><img src="https://cdn.pixabay.com/photo/2017/08/01/22/38/flash-2568381__340.jpg" alt="A thunder" width="75">
<div>
<a href="#" class="related-link">The Unkown Power of CSS</a>
<p class="related-author">By Jim Dillon</p>
</div>
</li>
<li class="related-post"><img src="https://miro.medium.com/max/1400/0*hEFTnzz-DUAjbtIG" alt="JavaScript code" width="75">
<div>
<a href="#" class="related-link"> Why JavaScript is Awesome</a>
<p class="related-author">By Matilda</p>
</div>
</li>
</ul>
</aside>
<!-- </div> -->
<footer>
<p id="copyright" class="copyright text">Copyright © 2022 The Code Magazine</p>
</footer>
</div>
</body>
</html>
* {
/* border-top: 10px solid #1098ad; */
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Page Sections */
body {
color: #444;
font-family: sans-serif;
border-top: 10px solid #1098ad;
position: relative;
}
.container {
width: 1200px;
/* margin-left: auto;
margin-right: auto; */
margin: 0 auto;
}
.main-header {
background-color: #f7f7f7;
/* padding: 20px;
padding-left: 40px;
padding-right: 40px; */
padding: 20px 40px;
/* margin-bottom: 60px; */
/* height: 80px; */
}
nav {
font-size: 18px;
text-align: center;
}
article {
/* margin-bottom: 60px; */
}
.post-header {
margin-bottom: 40px;
/* position: relative; */
}
aside {
background-color: #f7f7f7;
border-top: 5px solid #1098ad;
border-bottom: 5px solid #1098ad;
padding: 50px 40px;
}
/* Smaller Elements */
h1,
h2,
h3 {
color: rgba(75, 231, 197, 0.685);
}
h1 {
font-size: 26px;
text-transform: uppercase;
font-style: italic;
}
h2 {
font-size: 40px;
margin-bottom: 30px;
}
h3 {
font-size: 30px;
margin-bottom: 20px;
margin-top: 40px;
}
h4 {
font-size: 20px;
text-transform: uppercase;
text-align: center;
margin-bottom: 30px;
}
p {
font-size: 22px;
line-height: 1.5;
margin-bottom: 15px;
}
ul,
ol {
margin-left: 50px;
margin-bottom: 20px;
}
li {
font-size: 20px;
margin-bottom: 10px;
/* display: inline; */
}
li:last-child {
margin-bottom: 0;
}
/* footer p {
font-size: 16px;
} */
/*
article header p {
font-style: italic;
}
*/
#author {
font-style: italic;
font-size: 18px;
}
#copyright {
font-size: 16px;
}
.related-author {
font-size: 18px;
font-weight: bold;
}
.puntos {
list-style: none;
margin-left: 0;
}
body {
/* background-color: gray; */
}
/*
.first-li {
font-weight: bold;
}
*/
li:first-child {
font-weight: bold;
}
li:last-child {
font-style: italic;
}
li:nth-child(even) {
/* color: red; */
}
/* Misconceptio: this won't work! */
article p:last-child {
color: red;
}
/* Styling Hyperlinks: style elemnts that have href attribute */
a:link {
color: rgba(75, 231, 197, 0.685);
text-decoration: none;
}
a:visited {
/* color: #777; */
color: rgba(75, 231, 197, 0.685);
}
a:hover {
color: red;
font-weight: bold;
text-decoration: underline red;
}
a:active {
background-color: bisque;
font-style: italic;
}
/* LVHA */
.post-img {
width: 100%;
height: auto;
}
nav a:link {
/* background-color: #1098ad;
margin: 20px;
padding: 20px;
display: block; */
margin-right: 30px;
display: inline-block;
}
nav a:link:last-child {
margin-right: 0;
}
button {
font-size: 22px;
padding: 20px;
cursor: pointer;
position: absolute;
/* top: 50px;
left: 50px; */
bottom: 50px;
right: 50px;
}
h1::first-letter {
font-style: normal;
margin-right: 5px;
}
h3 + p::first-line {
/* color: #1098ad; */
}
h2 {
/* background-color: blanchedalmond; */
position: relative;
}
h2::after {
content: "TOP";
background-color: yellow;
color: black;
font-size: 16px;
font-weight: bold;
display: inline-block;
padding: 5px 10px;
position: absolute;
top: -10px;
right: -25px;
}
/* Resolving conflicts */
/* id has the highest priority */
/*
#copyright {
color: red;
}
.copyright {
color: blue;
}
.text {
color: yellow;
}
footer p {
color: green !important;
}
*/
/*
nav a:link,
nav p {
font-size: 18px;
}
*/
/* FLOATS */
/*
.author-img {
float: left;
margin-bottom: 20px;
}
.author {
margin-top: 10px;
float: left;
margin-left: 20px;
}
h1 {
float: left;
}
nav {
float: right;
}
.clear {
clear: both;
}
.clearfix::after {
clear: both;
content: "";
display: block;
}
article {
width: 825px;
float: left;
}
aside {
width: 300px;
float: right;
}
footer {
clear: both;
}
*/
/* flexbox */
.main-header {
display: flex;
align-items: center;
justify-content: space-between;
}
.author-box {
display: flex;
align-items: center;
}
.author {
margin-bottom: 0;
margin-left: 15px;
}
.related-post {
display: flex;
align-items: center;
gap: 20px;
margin-bottom: 30px;
}
.related-link:link {
font-size: 17px;
font-weight: bold;
font-style: normal;
margin-bottom: 5px;
display: block;
}
.related-author {
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
font-style: italic;
}
/* Flexbox Layout */
/* .row {
display: flex;
gap: 75px;
margin-bottom: 60px;
align-items: flex-start;
}
article {
flex: 1;
margin-bottom: 0;
}
aside {
DEFAULTS:
flex-grow:0;
flex-shrink:1;
flex-basis: auto;
flex: 0 0 300px;
}
*/
/* CSS GRID LAYOUT */
.container {
display: grid;
grid-template-columns: 1fr 300px; /* The first column will get the remaining space and the aside only 300px space */
column-gap: 75px;
row-gap: 60px;
align-items: start;
}
.main-header {
/* grid-column: 1 / span 2; */
/* column one and expand to the end: the code below */
grid-column: 1/-1; /* cover from the begining to the end */
}
article {
}
aside {
}
footer {
/* background-color: antiquewhite; */
grid-column: 1/-1;
}
Also see: Tab Triggers