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. 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.
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.
If the stylesheet 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 CSS 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.
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.
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Coding a Mockup - WIP</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<sitewrapper>
<header>
<ul class="header">
<li class="logo"><a href="#"><img src="http://seansmyth.ie/wp-content/uploads/2019/03/acme-logo-1.svg" alt="Logo" class="logo"></a></li>
<li><a href="#">Categories</a></li>
<li><a href="#">Places</a></li>
<li><a href="#">About</a></li>
<li class="search"><a href="#"><img src="http://seansmyth.ie/wp-content/uploads/2019/03/585e4ae9cb11b227491c33941.png" alt="search icon">Search</a></li>
<li><a href="#" class="button">Subscribe</a></li>
</ul>
</header>
<section class="sidebar">
<h1>Latest</h1>
<ul>
<li>
<h2>Explore</h2>
<p>Nulla vitae elit libero, a Nulla vitae elit libero, a pharetra augue, augue.</p>
</li>
<li>
<h2>Lorem Risus</h2>
<p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
</li>
<li>
<h2>Justo Ligula</h2>
<p>Donec ullamcorper nulla non metus auctor fringilla.</p>
</li>
<li>
<h2>Elit Nullam</h2>
<p>Nullam quis risus eget u egestas eget quam.</p>
</li>
</ul>
</section>
<article>
<header class="entry-header">
<h1> <span>Five reasons to visit Edinburgh, Scotland</span></h1>
<div class="entry-meta">
<span class="posted-on">
<a href="#" rel="bookmark"><time class="entry-date published" datetime="2008-10-17T04:33:51+00:00">October 17, 2008</time></a>
</span>
<span class="byline">by <span> <a href="#">Sean Smyth</a></span>
</span>
</div><!-- .entry-meta -->
<p>Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Vestibulum id ligula porta felis euismod semper. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam id dolor id nibh ultricies vehicula ut id elit...</p>
</header>
<img src="https://seansmyth.ie/wp-content/uploads/2017/02/18.jpg" alt="Edinburgh, Scotland">
</article>
<footer>
<ul class="social_icons">
<li><a href="#">
<svg class="twitter" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z"/></svg>
</a></li>
<li><a href="#">
<svg class="instagram" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>
</a></li>
<li><a href="#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M9 8h-3v4h3v12h5v-12h3.642l.358-4h-4v-1.667c0-.955.192-1.333 1.115-1.333h2.885v-5h-3.808c-3.596 0-5.192 1.583-5.192 4.615v3.385z"/></svg></a></li>
</ul>
<div class="unicorn"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
<g><g><path d="M793.5,400.4c8.1-27.4,12.6-56.2,12.6-86.2c0-168.8-137.3-306-306-306c-168.8,0-306,137.3-306,306c0,29.9,4.5,58.8,12.6,86.2C91.8,444.6,10,555.7,10,685.8c0,168.7,137.3,306,306,306c69.1,0,132.7-23.3,184-62.1c51.3,38.8,114.9,62.1,184,62.1c168.7,0,306-137.3,306-306C990,555.7,908.2,444.6,793.5,400.4z M257.5,314.2c0-133.7,108.8-242.5,242.5-242.5c133.7,0,242.5,108.8,242.5,242.5c0,24.3-3.7,47.6-10.3,69.8c-15.8-2.5-31.8-4.2-48.2-4.2c-69.1,0-132.7,23.3-184,62.1c-51.3-38.8-114.9-62.1-184-62.1c-16.4,0-32.5,1.7-48.2,4.2C261.2,361.8,257.5,338.4,257.5,314.2z M558.5,685.8c0,60.2-22.1,115.1-58.5,157.6c-36.4-42.4-58.5-97.4-58.5-157.6c0-24.3,3.7-47.6,10.3-69.8c15.7,2.5,31.8,4.2,48.2,4.2c16.4,0,32.5-1.7,48.2-4.2C554.9,638.1,558.5,661.6,558.5,685.8z M414.6,540.9c-49.3-18.6-90.9-52.8-118.9-96.6c6.7-0.6,13.5-1,20.4-1c50.8,0,97.9,15.7,136.9,42.5C438.3,502.7,425.3,521.1,414.6,540.9z M547.1,485.8c39-26.8,86.1-42.5,136.9-42.5c6.9,0,13.6,0.5,20.4,1c-28,43.8-69.6,77.9-118.9,96.6C574.7,521.1,561.8,502.7,547.1,485.8z M73.5,685.8c0-103.6,65.4-192,157.1-226.7c34.6,64,91.4,114.1,160,140.5c-8,27.4-12.6,56.2-12.6,86.2c0,76.5,28.4,146.3,74.9,200c-39,26.8-86.1,42.5-136.9,42.5C182.3,928.3,73.5,819.5,73.5,685.8z M684,928.3c-50.8,0-97.9-15.7-136.9-42.5c46.5-53.7,74.9-123.5,74.9-200c0-29.9-4.5-58.8-12.6-86.2c68.6-26.4,125.4-76.5,160-140.5c91.6,34.7,157.1,123.1,157.1,226.7C926.5,819.5,817.7,928.3,684,928.3z"/></g>
</svg></div>
<div class="copyright">
<a href="#">Developed by Seán Smyth</a>
<span>based on the Dribble shot "<a href="https://dribbble.com/shots/3111755-The-Big-Landscape">The Big Landscape</a>"</span>
</div>
</footer>
</sitewrapper>
</body>
</html>
@import url("https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/8.0.0/sanitize.css");
/*________________________ VARIABLES - START ________________________*/
:root {
--main-text: hsla(3, 92%, 7%, 1);
--main-text-light: hsla(3, 92%, 15%, 1);
--main-text-lightest: hsla(3, 92%, 40%, .1);
--white: hsla(59, 91%, 94%, 1);
--main-color: hsla(56, 100%, 60%, 1);
--main-color-dark: hsla(56, 82%, 38%, 1);
--main-coral: hsla(343, 82%, 44%, 1);
--main-coral-dark: hsla(344, 74%, 40%, 1);
}
/*________________________ VARIABLES - END ________________________*/
/*________________________ RESETS - START ________________________*/
html {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
*,
*:before,
*:after {
-webkit-box-sizing: inherit;
-moz-box-sizing: inherit;
box-sizing: inherit;
}
/*________________________ RESETS - END ________________________*/
/*________________________ GLOBAL - START ________________________*/
body
{
min-width: 100vw;
min-height: 100vh;
overflow-x: hidden;
}
a {
color: var(--main-text);
transition: background .4s;
}
a:hover {
background: var(--main-color);
}
::selection {
background: var(--main-coral);
/* WebKit/Blink Browsers */
}
::-moz-selection {
background: var(--main-coral);
/* Gecko Browsers */
}
/*________________________ GLOBAL - END ________________________*/
/*________________________ COMPONENTS - START ________________________*/
a.button {
background-color: var(--main-color);
text-decoration: none;
transition: background-color .2s ease,
color .3s ease;
height: 100%;
display: flex;
align-self: center;
padding: 1rem 2rem;
border-radius: .2rem;
}
a.button:hover {
background-color: var(--main-color-dark);
color: var(--white) !important;
}
/*________________________ COMPONENTS - END ________________________*/
/*________________________ LAYOUT - START ________________________*/
body {
padding: 2rem;
display: flex;
}
sitewrapper {
border: 1rem solid var(--main-color);
display: grid;
grid-gap: 1rem;
width: 100%;
grid-template-areas:
"header header header"
"sidebar main main"
"footer footer footer";
@media screen and (max-width: 700px)
{
grid-template-areas:
"header"
"main"
"sidebar"
"footer";
}
padding: 2rem 3rem 1rem 3rem;
background: white;
-webkit-box-shadow: 0px 0px 38px 12px rgba(0, 0, 0, 0.26);
-moz-box-shadow: 0px 0px 38px 12px rgba(0, 0, 0, 0.26);
box-shadow: 0px 0px 38px 12px rgba(0, 0, 0, 0.26);
}
body::after {
content: " ";
// display: block;
width: 100vw;
height: 100vh;
background-color: var(--main-color);
position: absolute;
bottom: -50vh;
padding: 0;
margin: 0;
z-index: -2;
-webkit-transform: rrotate(-57deg) translateY(20vw);
transform: rotate(-57deg) translateY(20vw);
}
header {
grid-area: header;
/* background: cyan; */
}
section.sidebar {
grid-area: sidebar;
/* background: blue; */
}
article {
grid-area: main;
/* background: green; */
}
footer {
grid-area: footer;
/* background: yellow; */
}
/*________________________ LAYOUT - END ________________________*/
/*________________________ HEADER - START ________________________*/
header {
ul,
li {
list-style: none;
display: inline-flex;
flex-direction: row;
width: 100%;
align-items: stretch;
}
}
ul.header {
margin: 1rem 0rem 0 0;
padding: 0 1rem 0 0;
font-weight: 600;
flex-wrap: wrap;
}
.header img {
max-width: 10rem;
}
.header {
.logo {
margin-right: 2rem;
}
}
ul.header li {
flex-basis: content;
}
ul.header li a:not(.button) {
text-decoration: none;
height: 100%;
width: 100%;
display: flex;
align-items: center;
padding: 0 1rem;
}
header li:first-child
/* logo li */
{
margin-right: 10rem;
}
header li:first-child a:hover
/* logo li */
{
/* margin-right: 10rem; */
background: none;
}
li.search {
margin-left: auto !important;
margin-right: 2rem;
}
header li.search img {
height: 1.5rem;
margin-right: 1rem;
}
/*________________________ HEADER - END ________________________*/
/*________________________ Sidebar - START ________________________*/
.sidebar {
font-size: 80%;
max-width: 30ch;
padding-right: 2rem;
h1 {
text-transform: uppercase;
font-size: 1.2rem;
letter-spacing: 2px;
margin-bottom: 3.5rem;
}
h2 {
font-weight: bold;
font-size: .8rem;
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
li {
margin-bottom: 2rem;
}
p {
text-transform: uppercase;
font-size: .8rem;
line-height: 1.4rem;
}
}
/*________________________ Sidebar - End ________________________*/
/*________________________ article - START ________________________*/
article {
display: grid;
grid-template-columns: 1fr 1fr;
header {
grid-column: 1 / -1;
grid-row: 1 / -1;
z-index: 12;
h1 {
pointer-events: none;
letter-spacing: 2px;
font-weight: bolder;
font-size: 2.7rem;
padding-right: 10%;
span {
background-image: linear-gradient(to right, var(--main-color) 0%,var(--main-color) 100%);
background-repeat: repeat-x;
background-position: 0 90%;
background-size: 100% 10px;
}
}
.entry-meta {
margin-bottom: 2rem;
time,
span {
font-size: .8rem;
}
}
p {
padding-left: 8%;
line-height: 1.9rem;
max-width: 50%;
width: 50%;
@media screen and (max-width: 900px)
{
width: 70%;
max-width: 100%;
}
@media screen and (max-width: 800px)
{
width: 100%;
max-width: 100%;
}
@media screen and (max-width: 700px)
{
width: 100%;
max-width: 100%;
padding:0;
}
}
}
img {
grid-column: 1 / -1;
grid-row: 1 / -1;
justify-self: end;
z-index: 2;
border-radius: 9999rem;
opacity: .8;
width: 100%;
object-fit: cover;
width: 30vw;
height: 30vw;
-webkit-filter: grrayscale(100%) brightness(.9) contrast(2);
/* Safari 6.0 - 9.0 */
filter: grayscale(100%) brightness(.9) contrast(1);
transition:
opacity .2s,
filter .5s;
}
img:hover {
-webkit-filter: none;
filter: none;
opacity: 1;
}
}
/*________________________ article - END ________________________*/
/*________________________ FOOTER - START ________________________*/
footer {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: flex-end;
font-size: .8rem;
@media screen and (max-width: 700px)
{
flex-direction: column;
text-align: center;
align-items: center;
}
ul.social_icons {
display: flex;
list-style: none;
padding: 0;
justify-content: space-around;
min-width: 150px;
@media screen and (max-width: 700px)
{
align-items: stretch;
justify-content: space-around;
width: 50%;
margin-bottom: 2rem;
}
}
.unicorn {
font-size: 2rem;
svg {
max-height: 30px;
}
@media screen and (max-width: 700px)
{
text-align: center;
margin-bottom: 2rem;
}
}
.copyright {
text-align: right;
display: flex;
flex-direction: column;
@media screen and (max-width: 700px)
{
text-align: center;
}
a {
font-weight: bold;
text-decoration: none;
margin-bottom: .5rem;
}
}
}
/*________________________ FOOTER - END ________________________*/
Also see: Tab Triggers