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.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap 4 Website Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<style>
.fakeimg {
height: 200px;
background: #aaa;
}
</style>
</head>
<body id="bg">
<div class="jumbotron text-center" style="margin-bottom:0">
<h1 class="text-info">Climate Change </h1>
<h1>
<a href="" class="typewrite"data-period="2000" data-type='[ "What is climate change?", "What problems does it causes?." ]'>
<span class="wrap"></span>
</a>
</h1>
</div>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<button type="button" class="btn btn-info"> Solutions </button>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">facts</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About climate change</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">More</a>
</li>
</ul>
</div>
</nav>
<div class="container" style="margin-top:30px">
<div class="row">
<div class="col-sm-6">
<h2 class="text-warning">Cause of Climate change</h2>
<h5 class="text-warning">Facts:</h5>
<iframe width="560" height="315" src="https://www.youtube.com/embed/G4H1N_yXBiA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p> Climate change includes the change of temperature in a place and can be connected to global warming that is caused by human emissions of greenhouse gases, and resulting in a large-scale shifts in weather patterns. This is important because it helps us understand what is the reason that climate change is caused. </p>
<h3 class="text-info">More</h3>
<p>Where to find more information:</p>
<ul class="nav nav-pills flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://climate.nasa.gov/effects/">NASA GLOBAL CLIMATE CHANGE</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://www.epa.gov/climate-change">EPA CLAMATE CHANGE</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
<hr class="d-sm-none">
</div>Ω
<div class="col-sm-5">
<h2 class="text-info" >Problems</h2>
<h5>What are some problems caused by climate change</h5>
<img src="https://media3.giphy.com/media/lTXI3qjhKt6x8jFND3/giphy.gif?cid=ecf05e4720mio294noghy4xklrc7rbk1of6f5v5ojwzfj9yc&rid=giphy.gif&ct=g" alt="..." class="img-thumbnail">
<p></p>
<p class= "">Global climate causes a lot of problem for us. The leves of the sea increase that is a problem for us as the increase of the sea level threatens coastal zones by causing flooding, it damages the land by filling it with sea salt that can become harmful and a problem for the people, animals, and plants that are habitats of that land which can prevent the land from growth. Another problem that it brings is that the temperature drastically increase wich cause the lands to dry and it can causes diferent parst of the world to change this can cuse a big inpact on the animals, plants and people that live in that part of the world.</p>
<br>
<h2 class="text-info">How to help</h2>
<h5>Can we prebent more climate change?</h5>
<div id="demo" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
</ul>
<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://images.penguinrandomhouse.com/cover/9780143135678" alt="beautiful">
</div>
<div class="carousel-item">
<img src="https://image.freepik.com/free-vector/save-planet-design_23-2148504123.jpg" alt="art">
</div>
<div class="carousel-item">
<img src="https://cdn.mos.cms.futurecdn.net/gHehXthXVJAL4GtesNUmmY.jpg" alt="New York">
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
<p class="text-warning">Be part of the solution</p>
<p>Some thing that we can do to help stope climate change is by taking about it more speak up about what is happening and why is it a problem, invest in energy-efficient appliances, try to reduce water waste,Power your home with renewable energy, and make less toxic gases like carbon diox. </p>
</div>
</div>
</div>
<div class="jumbotron text-center" style="margin-bottom:0">
<p>Footer</p>
</div>
<div class="progress">
</body>
</html>
body {
background-color:#ce3635;
text-align: center;
color:#fff;
}
* { color:text-success; text-decoration: none;}
#bg{
background-image: url("https://wallpapercave.com/wp/wp6789473.jpg");
}
var TxtType = function(el, toRotate, period) {
this.toRotate = toRotate;
this.el = el;
this.loopNum = 0;
this.period = parseInt(period, 10) || 2000;
this.txt = '';
this.tick();
this.isDeleting = false;
};
TxtType.prototype.tick = function() {
var i = this.loopNum % this.toRotate.length;
var fullTxt = this.toRotate[i];
if (this.isDeleting) {
this.txt = fullTxt.substring(0, this.txt.length - 1);
} else {
this.txt = fullTxt.substring(0, this.txt.length + 1);
}
this.el.innerHTML = '<span class="wrap">'+this.txt+'</span>';
var that = this;
var delta = 200 - Math.random() * 100;
if (this.isDeleting) { delta /= 2; }
if (!this.isDeleting && this.txt === fullTxt) {
delta = this.period;
this.isDeleting = true;
} else if (this.isDeleting && this.txt === '') {
this.isDeleting = false;
this.loopNum++;
delta = 500;
}
setTimeout(function() {
that.tick();
}, delta);
};
window.onload = function() {
var elements = document.getElementsByClassName('typewrite');
for (var i=0; i<elements.length; i++) {
var toRotate = elements[i].getAttribute('data-type');
var period = elements[i].getAttribute('data-period');
if (toRotate) {
new TxtType(elements[i], JSON.parse(toRotate), period);
}
}
// INJECT CSS
var css = document.createElement("style");
css.type = "text/css";
css.innerHTML = ".typewrite > .wrap { border-right: 0.08em solid #fff}";
document.body.appendChild(css);
};
Resources
Also see: Tab Triggers