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 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.
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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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.
<div id="main">
<header class="text-center">
<div class="headline">
<h1 id="title">Bruce Lee</h1>
</div>
</header>
<div id="img-div">
<img id="image" src="https://bruceleefoundation.org/wp-content/uploads/2016/03/ATTITUDE-DETERMINES-ALTITUDE-600x600.jpg" alt="pic from Bruce Lee Foundation" />
<div id="img-caption">
Tribute to the Master
</div>
</div>
<div class="container">
<aside>
<h2 class="text-center">Film</h2>
<ul>
<li>1969 - Marlowe</li>
<li>1971 - The Big Boss</li>
<li>1972 - Way of the Dragon</li>
<li>1972 - Fist of Fury</li>
<li>1973 - Enter the Dragon</li>
<li>1979 - The Real Bruce Lee</li>
<li>2010 - Bruce Lee, My Brother</li>
</ul>
</aside>
<section id="tribute-info">
<p>Lee Jun-fan (Chinese: 李振藩; November 27, 1940 – July 20, 1973), known professionally as Bruce Lee, was a Hong Kong and American actor, martial artist, philosopher, filmmaker, and founder of the martial art Jeet Kune Do. Lee was the son of Cantonese
opera star Lee Hoi-Chuen. He is widely considered by commentators, critics, media, and other martial artists to be one of the most influential martial artists of all time,[3] and a pop culture icon of the 20th century. He is often credited with
helping to change the way Asians were presented in American films.</p>
<p>Lee was born in Chinatown, San Francisco on November 27, 1940 to parents from Hong Kong and was raised in Kowloon, Hong Kong with his family until his late teens. He was introduced to the film industry by his father and appeared in several films
as a child actor. Lee moved to the United States at the age of 18 to receive his higher education, at the University of Washington, at Seattle and it was during this time that he began teaching martial arts. His Hong Kong and Hollywood-produced
films elevated the traditional Hong Kong martial arts film to a new level of popularity and acclaim, sparking a surge of interest in Chinese martial arts in the West in the 1970s. The direction and tone of his films changed and influenced martial
arts and martial arts films in the US, Hong Kong and the rest of the world.</p>
<p>He is noted for his roles in five feature-length films: Lo Wei's The Big Boss (1971) and Fist of Fury (1972); Golden Harvest's Way of the Dragon (1972), directed and written by Lee; Golden Harvest and Warner Brothers' Enter the Dragon (1973) and
The Game of Death (1978), both directed by Robert Clouse.[9] Lee became an iconic figure known throughout the world, particularly among the Chinese, as he portrayed Chinese nationalism in his films. He trained in the art of Wing Chun and later
combined his other influences from various sources, in the spirit of his personal martial arts philosophy, which he dubbed Jeet Kune Do (The Way of the Intercepting Fist). Lee held dual nationality of Hong Kong and the US. He died in Kowloon Tong
on July 20, 1973 at the age of 32.</p>
</section>
<a id="tribute-link" href="https://en.wikipedia.org/wiki/Bruce_Lee" target="_blank">more info on Wikipedia</a>
</div>
<hr/>
<footer class="text-center">Written and coded by David Sabalete</footer>
</div>
body {
background-color: #000;
}
aside {
float: right;
clear: right;
width: 200px;
background-color: #f8f8f8;
padding: 10px;
margin: 10px;
}
aside ul {
list-style: none;
padding: 0px;
}
.container {
padding: 50px;
background-color: #ccc;
}
header { padding: 40px;}
.headline h1 {
font-size: 80px;
color: #aaa;
}
#image {
display: block;
max-width: 600px;
margin: auto;
}
#img-caption {
color: #aaa;
text-align: center;
margin: 1em;
}
footer {
color: #aaa;
}
Also see: Tab Triggers