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.
<body>
<header>
<h1 class="title">The Fog Wall</h1>
</header>
<nav>
<p class="category">Categories</p>
<ul class="nav-list">
<li class="nav-links"><a href="">Film & cinema</a></li>
<li class="nav-links"><a href="">Books & Reading</a></li>
<li class="nav-links"><a href="">Games & Consoles</a></li>
<li class="nav-links"><a href="">Food & Drink</a></li>
<li class="nav-links"><a href="">World News</a></li>
<li class="nav-links"><a href="">Outdoor Living</a></li>
</ul>
</nav>
<main>
<div class="main-container">
<h2 id="article-title">The Best 5 Open World Adventure Games</h2>
<img src="https://assets2.rockpapershotgun.com/elden-ring-limgrave-vista.jpg/BROK/resize/1920x1920%3E/format/jpg/quality/80/elden-ring-limgrave-vista.jpg" alt="">
<p class="article-text">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Labore ea doloribus quam esse maiores reprehenderit ducimus incidunt? Quae dolore enim tempore nihil delectus placeat sed corrupti recusandae in quas saepe ipsam fugit beatae doloremque quaerat fugiat, accusantium provident explicabo deleniti? Saepe inventore ipsa rem delectus est maxime tempora voluptates, exercitationem non quae, voluptate harum. Dolore velit, nihil culpa adipisci, neque laborum, mollitia dolores totam ex pariatur consectetur molestias est. Autem facere ut unde omnis aliquid veritatis tempore perferendis, libero necessitatibus hic at similique quaerat earum nam impedit animi debitis ad. Nam suscipit delectus perspiciatis eum, placeat nihil ad. Ullam, repellat?Lorem ipsum dolor sit, amet consectetur adipisicing elit. Praesentium exercitationem, minus placeat in hic incidunt nihil
</p>
<p class="article-text">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Fugiat, architecto eius voluptatibus suscipit vitae ipsam ratione voluptatem, quaerat, unde modi cupiditate corporis maiores. Magnam at molestias quisquam. Odio distinctio veniam nemo porro. Tempora at rem impedit! Ex doloribus placeat beatae.
</p>
<p class="article-text">Lorem ipsum dolor sit amet consectetur adipisicing elit. Ea repudiandae corporis odio incidunt voluptate vitae, culpa veniam eaque consequuntur non itaque facere recusandae harum earum dignissimos iure voluptatum neque numquam consequatur possimus quidem in, officia quam architecto? Eveniet, placeat non? Ab nihil rerum et minus hic deserunt impedit quidem voluptas corporis! Optio voluptate quia consequuntur quaerat excepturi necessitatibus nam, ea animi mollitia veritatis ipsa incidunt sunt iste ipsam quas accusamus deserunt nihil doloribus nesciunt amet minus id vel? Similique cupiditate possimus unde voluptatum mollitia eum commodi asperiores cumque totam nesciunt earum molestias impedit explicabo facilis illum aut dolorum veniam cum et non, sunt, temporibus rerum accusantium? Numquam molestias eum alias eveniet fugiat voluptatem eius autem doloremque expedita, amet, quis unde saepe earum aliquam, ratione totam dolorem libero architecto dicta! Earum a velit consequatur nemo quam modi, quis magni voluptatem. Dolorum sit temporibus, vero repellat incidunt amet quia similique quod doloribus omnis accusamus? Dolore recusandae aliquid placeat tempore dolorem aspernatur iusto obcaecati. Inventore necessitatibus obcaecati doloremque suscipit praesentium eum est ducimus. Voluptates eligendi dicta numquam, minus pariatur odio architecto earum vero. Sunt qui recusandae asperiores. Aspernatur iusto, reiciendis facere fugiat eius ex ullam tempore adipisci, incidunt corrupti cupiditate! Consectetur pariatur dolorem eveniet sit doloremque, voluptatibus praesentium numquam eaque libero labore vitae et cupiditate cumque voluptate provident, ad, perspiciatis placeat quisquam suscipit animi! Omnis vel ipsum similique, quam aliquam et doloribus neque?</p>
<p class="article-text">
Lorem ipsum dolor sit amet consectetur adipisicing elit. At commodi sunt molestiae pariatur reprehenderit illo vero, odio a. Atque blanditiis obcaecati architecto accusamus velit non assumenda libero consequatur eveniet quasi excepturi, eligendi repudiandae hic amet nostrum voluptatem alias itaque temporibus illo ad fugiat similique at facere. Dolores quibusdam voluptas quis, sint provident fugiat alias assumenda nihil? Pariatur, dolor? Soluta porro quas, ea fugit sunt enim dolores fugiat aut facilis a veniam aliquam impedit itaque laboriosam similique rerum, sapiente saepe eum, consectetur placeat? Tempore sit consequuntur voluptate error, suscipit expedita non necessitatibus aliquam voluptas. Eveniet minima officiis accusantium eius cupiditate dolorum ex labore quis, deserunt, corrupti neque eum temporibus ipsum tempore, autem vero. At rerum reiciendis provident possimus cupiditate odit quia!
</p>
</div>
</main>
<aside>
<p class="detail-question">Published on:</p>
<p class="detail-answer">May 15th 2022</p>
<p class="detail-question">In the category:</p>
<p class="detail-answer">Games & consoles</p>
<p class="detail-question">Written by:</p>
<p class="detail-answer">Mario</p>
</aside>
</body>
*{
padding:0;
margin:0;
}
body{
background-color:white;
display: grid;
grid-template-columns: repeat(11, 1fr);
font-family: 'Lato', sans-serif;
}
header, nav, main, aside{
border:1px solid black;
}
header{
grid-column:1/12;
padding:1.5rem;
text-align:center;
}
nav{
grid-column:1/3;
}
main{
grid-column:3/10;
padding:1rem 3rem;
display:flex;
flex-direction:column;
align-items:center;
}
.main-container{
display:flex;
justify-content:center;
flex-direction:column;
}
aside{
grid-column:10/12
}
nav,aside{
padding:1rem;
}
nav
.title{
font-size:3rem;
font-weight:700;
}
.category{
margin-top:2rem;
font-weight:700;
}
.nav-list{
margin-top:1rem;
list-style-type:none;
}
.nav-links{
margin-top:0.2rem;
}
a{
color:black;
}
#article-title{
margin:2rem 0;
font-size:3.2rem;
font-weight:700;
display:block;
}
.article-text{
margin-top:2rem;
font-size:1.2rem;
}
.detail-question{
margin-top:2rem;
font-weight:700;
}
.detail-answer{
margin-top:.2rem;
}
img{
max-width:100%;
max-height:80%;
}
@media only screen and (max-width: 780px) {
body {
display: block;
}
.category{
margin:0;
}
.detail-question{
margin-bottom:.2rem;
}
}
Also see: Tab Triggers