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.
<!--
Material Cards Designed especiall for Posts with an Image and Post Information, Along with social buttons.
Responsive using flexbox.
Pure CSS, No JS
Images Used in Pen are Not Mine :
They are of Creative Artist from Dribbble
-Marko Stupic : https://dribbble.com/sweetness-every-day
-->
<div class="card-container">
<div class="card">
<div class="card-image"></div>
<div class="card-info">
<div class="card-title">Hie</div>
<div class="card-detail">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis beatae nisi soluta ex animi aperiam iste voluptatem, voluptatibus impedit rem natus doloribus sed ullam provident sunt odit eaque excepturi modi.</div>
</div>
<div class="card-social">
<ul>
<li><i class="fa fa-comment-o" aria-hidden="true"></i>
</li>
<li><i class="fa fa-heart-o" aria-hidden="true"></i></li>
<li><i class="fa fa-share-alt" aria-hidden="true"></i>
</li>
</ul>
</div>
</div>
<div class="card">
<div class="card-image"></div>
<div class="card-info">
<div class="card-title">Hello</div>
<div class="card-detail">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis beatae nisi soluta ex animi aperiam iste voluptatem, voluptatibus impedit rem natus doloribus sed ullam provident sunt odit eaque excepturi modi.</div>
</div>
<div class="card-social">
<ul>
<li><i class="fa fa-comment-o" aria-hidden="true"></i>
</li>
<li><i class="fa fa-heart-o" aria-hidden="true"></i>
</li>
<li><i class="fa fa-share-alt" aria-hidden="true"></i>
</li>
</ul>
</div>
</div>
<div class="card">
<div class="card-image"></div>
<div class="card-info">
<div class="card-title">How are you ?</div>
<div class="card-detail">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis beatae nisi soluta ex animi aperiam iste voluptatem, voluptatibus impedit rem natus doloribus sed ullam provident sunt odit eaque excepturi modi.</div>
</div>
<div class="card-social">
<ul>
<li><i class="fa fa-comment-o" aria-hidden="true"></i>
</li>
<li><i class="fa fa-heart-o" aria-hidden="true"></i>
</li>
<li><i class="fa fa-share-alt" aria-hidden="true"></i>
</li>
</ul>
</div>
</div>
<div class="card">
<div class="card-image"></div>
<div class="card-info">
<div class="card-title">What's Up ?</div>
<div class="card-detail">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis beatae nisi soluta ex animi aperiam iste voluptatem, voluptatibus impedit rem natus doloribus sed ullam provident sunt odit eaque excepturi modi.</div>
</div>
<div class="card-social">
<ul>
<li><i class="fa fa-comment-o" aria-hidden="true"></i></li>
<li><i class="fa fa-heart-o" aria-hidden="true"></i>
</li>
<li><i class="fa fa-share-alt" aria-hidden="true"></i>
</li>
</ul>
</div>
</div>
</div>
body
background: transparentize(blue,0.5)
.card-container
position: relative
flex-wrap: wrap
overflow: hidden
// background: transparentize(blue,0.5)
padding-top: 15px
padding-bottom: 15px
display: flex
justify-content: space-around
align-items: auto
.card
min-width: 275px
width: 275px
position: relative
margin: 15px 15px
height: 350px
border-radius: 7px
background-size: cover
background: transparentize(black,0.8)
box-shadow: 5px 5px 10px 1px transparentize(black,0.7)
transition: 0.2s all linear
border: 1px solid transparentize(grey,0.85)
box-sizing: border-box
.card-social
position: absolute
height: 75px
width: 100%
background: red
border-bottom-right-radius: 5px
border-bottom-left-radius: 5px
background: transparentize(black,0.4)
box-shadow: 2px 2px 10px 0px transparentize(black,0.5)
top: 275px
ul
padding: 0
margin: 0
list-style: none
width: 100%
height: 100%
display: flex
justify-content: space-around
li
// width: 30%
height: 100%
text-align: center
line-height: 75px
font-size: 1.5em
color: transparentize(white,0.15)
text-shadow: 5px 5px 5px transparentize(black,0.5)
&:hover
text-shadow: 7px 7px 5px transparentize(black,0.3)
transition: all 0.1s linear
.card-image
width: 100%
height: 275px
position: relative
background-image: url('https://d13yacurqjgara.cloudfront.net/users/150724/screenshots/2211976/365_the_end_1x.png')
border-top-right-radius: 5px
border-top-left-radius: 5px
.card-info
position: relative
width: 100%
height: 35px
line-height: 35px
top: -265px
border-top-right-radius: 5px
border-top-left-radius: 5px
font-family: 'Open Sans'
color: transparentize(white,0.15)
.card-title
line-height: 35px
height: 35px
position: relative
top: 0px
font-size: 25px
text-align: center
background: transparentize(black,0.4)
box-shadow: 5px 5px 10px 2px transparentize(black,0.7)
.card-detail
line-height: 1.5em
font-size: 1em
height: 220px
background: transparentize(black,0.4)
position: relative
top: 5px
padding: 5px 20px 0px 20px
opacity: 0
transform: scaleY(0)
transform-origin: center top
box-shadow: 5px 5px 10px 2px transparentize(black,0.7)
&:hover
box-shadow: 10px 10px 10px 1px transparentize(black,0.7)
.card-info
.card-title
box-shadow: 10px 10px 10px 1px transparentize(black,0.7)
transition: 0.3s all linear
.card-detail
opacity: 1
box-shadow: 10px 10px 10px 1px transparentize(black,0.7)
transition: 0.35s all linear
transition-delay: 0.1s
transform: scaleY(1)
&:nth-of-type(2)
.card-image
background-image: url('https://d13yacurqjgara.cloudfront.net/users/150724/screenshots/2164720/337_writing_blog_post_1x.png')
&:nth-of-type(3)
.card-image
background-image: url('https://d13yacurqjgara.cloudfront.net/users/150724/screenshots/2377046/kaylo_ren_lighsaber_800x600_1x.png')
&:nth-of-type(4)
.card-image
background-image: url('https://d13yacurqjgara.cloudfront.net/users/150724/screenshots/2203790/362_chasing_dreams_1x.png')
// No JS ;)
Also see: Tab Triggers