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.
<!-- макет9 -->
<!-- Header -->
<header class="header">
<div class="page headerPage">
<div class="logo">
<strong class="logoName">Elysa4t</strong>
</div>
<nav class="nav">
<ul class="menu">
<li class="menu__item"><a class="menu__link menu__link--bg" href="#">home</a></li>
<li class="menu__item"><a class="menu__link" href="#">archives</a></li>
<li class="menu__item"><a class="menu__link" href="#">gallery</a></li>
<li class="menu__item"><a class="menu__link" href="#">about</a></li>
<li class="menu__item"><a class="menu__link" href="#">contact</a></li>
</ul>
</nav>
</div>
</header>
<!-- Section -->
<section class="section">
<div class="page sectionPage">
<figure class="figure">
<img class="caption-bg" src="img/banner-caption-bg.png" alt="caption-bg">
<figcaption class="figcaption">Magna sed phasellus consequat lorem ipsum dolor</figcaption>
</figure>
</div>
</section>
<!-- Main -->
<main class="main">
<div class="page mainPage">
<div class="mainContent">
<div class="mainContent__postedHead">
<p class="mainPosted">Posted by <a href="#" class="mainPosted__link">Someone</a> on April 14, 2012</p>
<img class="mainTape" src="img/post-posted-bg.png" alt="tape">
</div>
<div class="mainContent__sectioin">
<p class="mainContent__called">Lorem ipsum sed veroeros amet</p>
<img class="mainContent__future" src="img/pics01.jpg" alt="The office of my street">
<p class="mainContent__textMore">
Nam vestibulum hendrerit orci, sed pharetra elit elementum in. Donec in eros sed odio varius tempus. Vestibulum quis quam et velit rutrum ornare nec a massa. Curabitur malesuada ullamcorper nunc in suscipit. Donec semper venenatis dui sed facilisis. Morbi congue facilisis ante in feugiat. Mauris consectetur magna eu enim sagittis et bibendum lacus imperdiet. Maecenas semper massa ac odio ornare sodales. Nunc rhoncus vulputate nisi sed malesuada. Fusce ac mauris dui, id luctus ligula. Integer hendrerit.
</p>
</div>
<div class="mainContent__postedFoot">
<p class="mainContent__posted">
Posted in
<a class="mainContent__link" href="#">News</a>,
<a class="mainContent__link" href="#">Design</a>,
<a class="mainContent__link" href="#">Other</a>
</p>
<p class="mainContent__posted"><a class="mainContent__link" href="#">235 Comments</a></p>
</div>
</div>
<!-- Sidebar -->
<div class="mainSidebar">
<div class="sidebarText">
<p class="sidebarText__title sidebarText__title--up">
About Elysa4t
</p>
<p class="sidebarText__content">
Mauris consectetur magna eu enim sagittis et bibendum lacus imperdiet. Maecenas semper massa amet et odio mauris dui, id luctus amet ligula.
</p>
</div>
<div class="sidebarLists">
<p class="sidebarLists__title">
Recent Post
</p>
<ul class="sidebarLists__items">
<li class="sidebarLists__item"><a href="#" class="sidebarLists__link">Hendrerit orci sed pharetra elit</a></li>
<li class="sidebarLists__item"><a href="#" class="sidebarLists__link">Donec in eros odio varius tempus</a></li>
<li class="sidebarLists__item"><a href="#" class="sidebarLists__link">Vestibulum quis quam et velit</a></li>
<li class="sidebarLists__item"><a href="#" class="sidebarLists__link">Rutrum ornare nec sed curabitur</a></li>
<li class="sidebarLists__item"><a href="#" class="sidebarLists__link">Malesuada ullamcorper nunc</a></li>
</ul>
</div>
<div class="sidebarText">
<p class="sidebarText__title">
Something Else
</p>
<p class="sidebarText__content">
Mauris consectetur magna eu enim sagittis et bibendum lacus imperdiet. Maecenas semper massa amet et odio mauris dui, id luctus amet ligula.
</p>
</div>
</div>
</div>
</main>
<!-- Article -->
<article class="article">
<div class="page articlePage">
<div class="articleContent">
<h4 class="articleContent__title">Just another widget</h4>
<p class="articleContent__text">Mauris consectetur magna tempus enim sagittis et bibendum lacus et imperdiet. Maecenas semper et massa amet et odio mauris dui, id luctus amet ligula.</p>
</div>
<div class="articleContent">
<h4 class="articleContent__title">Just another widget</h4>
<p class="articleContent__text">Mauris consectetur magna tempus enim sagittis et bibendum lacus et imperdiet. Maecenas semper et massa amet et odio mauris dui, id luctus amet ligula.</p>
</div>
<div class="articleContent">
<h4 class="articleContent__title">Just another widget</h4>
<p class="articleContent__text">Mauris consectetur magna tempus enim sagittis et bibendum lacus et imperdiet. Maecenas semper et massa amet et odio mauris dui, id luctus amet ligula.</p>
</div>
</div>
</article>
<!-- Footer -->
<footer class="footer">
<div class="page footerPage">
<ul class="footerMenu">
<li class="footerMenu__item">© Your Website Name</li>
<li class="footerMenu__item">Elysa4T by <a class="footerMenu__link" href="#">4Templates</a></li>
<li class="footerMenu__item">Photos by <a class="footerMenu__link" href="#">Fotogrph</a></li>
</ul>
</div>
</footer>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.page {
width: 1000px;
height: 100%;
margin: 0 auto;
font-family: "Trebuchet Ms", Arial, Helvetica, sans-serif;
}
/*HEADER*/
.header {
width: 100%;
height: 187px;
background: url("img/header-wrapper-bg.png") repeat-x;
}
.headerPage {
width: 1000px;
display: flex;
justify-content: space-between;
align-items: center;
}
.logoName {
width: 221px;
height: 110px;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 2em;
font: 4em "Cookie", cursive;
background: url("img/logo-bg.png") repeat;
}
.menu {
width: 800px;
display: flex;
justify-content: center;
}
.menu__item {
list-style-type: none;
margin-right: 50px;
}
.menu__link {
text-decoration: none;
text-transform: capitalize;
font: 1.2em "Arvo", serif;
color: #fff;
}
.menu__link--bg {
padding: 10px 13px;
background: url("img/menu-active-bg-01.png") no-repeat 0,
url("img/menu-active-bg-03.png") no-repeat 60px .5px,
url("img/menu-active-bg-02.png") repeat 0;
}
/*SECTION*/
.section {
width: 100%;
height: 350px;
background: url(img/banner-wrapper-bg.png);
display: flex;
flex-direction: column;
justify-content: center;
}
.sectionPage {
width: 960px;
height: 278px;
background: url(img/banner-image.jpg) no-repeat;
border-radius: 10px;
}
.figure {
height: 278px;
display: flex;
flex-direction: column;
justify-content: flex-end;
position: relative;
}
.caption-bg {
border-radius: 0 0 10px 10px;
}
.figcaption {
position: absolute;
font: 2em "Cookie", cursive;
color: #fff;
width: 960px;
height: 74px;
display: flex;
justify-content: center;
align-items: center;
}
/*MAIN*/
.main {
width: 100%;
background: url("img/page-wrapper-bg.png");
}
.mainPage {
width: 1000px;
display: flex;
align-items: center;
}
.mainContent,
.mainSidebar {
margin-right: 40px;
border-radius: 5px;
}
.mainContent {
flex: 2;
padding: 30px;
margin-top: 30px;
margin-bottom: 30px;
background: #fff;
}
.mainContent__postedHead {
position: relative;
margin-bottom: 20px;
}
.mainPosted {
position: absolute;
left: 0;
top: 10px;
color: #fff;
font-size: 15px;
}
.mainPosted__link {
color: #fff;
}
.mainTape {
margin-left: -30px;
}
.mainContent__sectioin,
.mainContent__called,
.mainContent__future {
margin-bottom: 20px;
}
.mainContent__called {
font-family: 'Arvo', serif;
font-size: 2.2em;
font-weight: 400;
}
.mainContent__future {
border-radius: 5px;
}
.mainContent__textMore {
font-size: .8em;
line-height: 2;
padding-right: 20px
}
.mainContent__postedFoot {
display: flex;
justify-content: space-between;
background: url("img/posted-meta-bg.png") no-repeat;
height: 66px;
align-items: center;
padding: 0 20px;
}
.mainContent__text,
.mainContent__link {
font: 1.1em "Arvo", serif;
color: #572F26;
}
.mainContent__link:hover {
text-decoration: none;
}
/*Sidebar*/
.mainSidebar {
width: 300px;
background: url("img/sidebar-bg-01.png") no-repeat,
url("img/sidebar-bg-03.png") no-repeat bottom,
url("img/sidebar-bg-02.png");
}
.sidebarText__title,
.sidebarLists__title {
background: url("img/sidebar-title-bg.png");
width: 330px;
height: 38px;
display: flex;
align-items: center;
padding-left: 30px;
}
.sidebarText__title--up {
margin-top: 30px;
}
.sidebarText__title,
.sidebarLists__title,
.sidebarLists__items {
color: #fff;
}
.sidebarText__content,
.sidebarLists__items {
padding: 30px;
}
.sidebarLists__items {
list-style-type: none;
}
.sidebarText__content {
color: #E1C9C4;
line-height: 1.5;
font-size: .8em;
}
.sidebarLists__link {
text-decoration: none;
color: #fff;
font-size: .8em;
}
.sidebarLists__item:nth-last-child(n+2) {
border-bottom: 1px solid #222;
padding: 7px 0;
}
.sidebarLists__item:last-child {
padding-top: 7px;
}
/*ARTICLE*/
.article {
width: 100%;
height: 260px;
background: url("img/footer-content-bg-02.png") repeat-x;
}
.articlePage {
width: 1000px;
display: flex;
justify-content: space-around;
align-items: center;
}
.articleContent {
height: 195px;
flex: 1;
margin-right: 40px;
margin-top: 10px;
border-radius: 5px;
background: rgba(82, 43, 35, .5);
box-shadow: 2px -2px 3px rgb(70, 38, 30),
-2px 2px 3px rgb(70, 38, 30),
2px 2px 3px rgb(70, 38, 30),
-2px -2px 3px rgb(70, 38, 30);
padding: 30px;
}
.articleContent__title {
font-family: "Arvo" serif;
color: #fff;
font-weight: 300;
margin-bottom: 20px;
}
.articleContent__text {
color: #E1C9C4;
font-size: .8em;
line-height: 1.8;
}
/*FOOTER*/
.footer {
width: 100%;
height: 155px;
background: url("img/footer-bg.png") repeat-x;
}
.footerMenu {
display: flex;
justify-content: center;
padding-top: 30px;
}
.footerMenu__item {
list-style-type: none;
font-size: .8em;
color: #784F45;
text-shadow: 1px 1px 1px rgba(0,0,0, .2);
}
.footerMenu__item:nth-child(2) {
border-left: 1px solid #784F45;
border-right: 1px solid #784F45;
padding: 0 7px;
}
.footerMenu__item:nth-child(odd) {
padding: 0 7px;
}
.footerMenu__link {
color: #784F45;
}
.footerMenu__link:hover {
text-decoration: none;
}
Also see: Tab Triggers