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.
.section
.oop
.fixed
h1.large Parallax Background
p No JavaScript, Start scrolling
.section
.fixed
h1 The Day My Mother Forgot to Cry
p I shudder to recall that dreadful Diwali night of October 2007, when my mother knocked our bed room at the dead of the night enquiring where the toilet was. She looked disoriented and totally confused. Unable to understand the cause for her abnormal behaviour, we thought she was still in a semi-sleep state and showed her the toilet. But even after coming out of toilet she was unable to find her way to her bed room.
.section
.p.fixed Sensing that something is seriously amiss, we took her next day to the nearby nursing home for diagnosis and treatment. She was immediately referred to a neurosurgeon and after a MRI scan it was confirmed that she suffered a brain stroke. The report showed certain grey patches which the doctor referred to as clots have affected her memory totally. The doctor informed that the memory loss is irreversible due to her old age. He, however, assured that further, damage to the brain can be arrested with drugs.
.section
.p.fixed That was the beginning of the slow end for my mother. As the disease got worsened, she forgot everything. Lost control of her body functions and finally, failed to recognize anyone except my wife who used to take care of her like a mother taking care of her baby. She used to feed her, change her diapers, dress her, give her bath, brush her hair, and also help her to sleep.
.section
.p.fixed For my wife and me, she was like a little child. Our world revolved around her. We used to play with her, tease her. We even celebrated her 80th birth day with a grand cake cutting ceremony attended by my wife’s friends in Kolkata. It was a moment of happiness for her as she kept smiling at every one greeting her on her birth day without knowing whose birth day it was. So when one of the guests greeted her with a “wish you a happy birth day”, she promptly responded by wishing her the same!
.section
.p.fixed It was interesting to know that even after destroying her brain cells; the disease could not take away the basic courtesies from her, acquired during her training as a Telephone Operator long long ago. They remained entrenched in her till her last breath. She never forgot to express her sincere thanks whenever we help her with little things.
.section
.p.fixed The thud sound of a body hitting the ground rudely awakened us. We looked around to find my mother missing from her bed. In a swift motion my wife jumped from the bed and dashed out of the room to find her lay flat, face down on the floor motion less. Her fore head was badly injured. She was bleeding profusely from her lips due to the impact of the fall. But there was virtually no reaction from her. We physically lifted her and put her on the bed. My wife gently cleansed the wound and enquired whether it was hurting. She replied in affirmative. But there was no sign of pain in the face. No tears in her eyes. Just plain disoriented look, devoid of any feelings and emotions. The disease took away all her emotional feelings and also dried up the tear glands. Looking at her state I cried silently.
.section
.p.fixed Oh God! I said to myself. Is this is my mother, who used to get tears in her eyes even for a faint discomfort? She was emotionally so sensitive that even a stern look, would bring her to tears. Such was her reputation for crying that my father used to tease her by calling her “Gangadhari”. Lady wearing river Ganges on her head.
.section
.p.fixed The day she passed away and as her body was being carried in a “Hearse” van there were unexpected showers for few minutes as if the heavens have cried for her, as she forgot to cry.
.section
p.fixed.white Thanks for watching
@import 'https://fonts.googleapis.com/css?family=Sintony';
* {
box-sizing: border-box;
}
body {
background: #222;
padding: 0;
margin: 0;
font-family: 'Sintony', sans-serif;
font-weight: 300;
font-size: 13px;
text-transform: uppercase;
color: #000;
}
header {
background-color: #fff;
padding: 0;
margin: 0;
}
.section {
text-align: center;
position: absolute;
width: 100%;
height: 100vh;
letter-spacing: 4px;
overflow: hidden;
clip: rect(0, auto, auto, 0);
.fixed {
overflow: hidden;
position: fixed;
top: 50%;
left: 50%;
}
.white {
color: #fff;
}
}
@for $i from 1 through 10 {
.section:nth-child(#{$i}) {
@if($i==1) {
background-color: #fff;
color: #000;
top: 0;
}
@else if($i==10) {
background-color: #000;
color: #fff;
top: (100vh * ($i - 1));
}
@else {
box-shadow: inset 0 1px 80px rgba(0, 0, 0, 0.14);
background-color: hsl(200deg * $i, 90%, 40%);
color: #fff;
top: (100vh * ($i - 1));
}
z-index: ($i);
.fixed {
transform: translate(-50%, -50%);
}
}
}
.oop {
position: relative;
z-index: auto;
height: 10px;
background: linear-gradient(141deg, #48ded4 0%, #a026bf 51%, #e82c75 75%);
}
Also see: Tab Triggers