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.
<nav class="navbar navbar-dark bg-dark" aria-label="First navbar example">
<div class="container-fluid">
<a class="navbar-brand" href="#">BOOTSTRAP 5</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample01" aria-controls="navbarsExample01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon red"></span>
</button>
<div class="collapse navbar-collapse" id="navbarsExample01">
<ul class="navbar-nav me-auto mb-2">
<li class="nav-item"><a class="nav-link" href="#">Hund</a></li>
<li class="nav-item"><a class="nav-link" href="#">Katze</a></li>
<li class="nav-item"><a class="nav-link" href="#">Maus</a></li>
<li class="nav-item"><a class="nav-link" href="#">Vogel</a></li>
</ul>
</div>
</div>
</nav>
<div class="px-4 pt-2 my-5 text-center">
<img class="d-block mx-auto mb-4" src="https://getbootstrap.com/docs/5.0/assets/brand/bootstrap-logo.svg" alt="" width="72" height="57">
<h1 class="display-3 fw-bold">Bootstrap 5</h1>
<div class="col-lg-6 mx-auto">
<p class="lead mb-1">Get started with <a href="https://getbootstrap.com">Bootstrap</a>, the world’s most popular framework for building responsive, mobile-first sites.</p>
</div>
</div>
<div class="divider"></div>
<div class="container col-xxl-8 px-4 pt-2 my-5">
<div class="row flex-lg-row-reverse align-items-center g-5 py-5">
<div class="col-10 col-sm-8 col-lg-6">
<img src="https://getbootstrap.com/docs/5.0/examples/heroes/bootstrap-themes.png" class="d-block mx-lg-auto img-fluid" alt="Bootstrap Themes" width="700" height="500" loading="lazy">
</div>
<section class="col-lg-6">
<h2 class="display-5 fw-bold"><i class="fab fa-css3 fa-spin"></i> CSS Framework.</h2>
<p class="lead">Quickly design and <em>customize</em> responsive mobile-first <a href="#">sites</a> with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive <strong>grid</strong> system, extensive prebuilt components, and powerful JavaScript plugins.</p>
<p><span class="badge bg-primary">Primary</span>
<span class="badge bg-secondary">Secondary</span>
<span class="badge bg-success">Success</span>
<span class="badge bg-danger">Danger</span><br>
<span class="badge bg-warning text-dark">Warning</span>
<span class="badge bg-info text-dark">Info</span>
<span class="badge bg-light text-dark">Light</span>
<span class="badge bg-dark">Dark</span></p>
</section>
</div>
</div>
<div class="divider"></div>
<section class="px-4 pt-4 text-center">
<h2 class="display-4 fw-bold">Portfolio</h2>
<div class="col-lg-6 mx-auto">
<p class="lead mb-4">Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.</p>
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center mb-5">
<button type="button" class="btn btn-primary btn-lg px-4 me-sm-3">Primary</button>
<button type="button" class="btn btn-outline-secondary btn-lg px-4">Secondary</button>
</div>
</div>
<div class="overflow-hidden" style="max-height: 30vh;">
<div class="container px-5">
<img src="https://getbootstrap.com/docs/5.0/examples/heroes/bootstrap-docs.png" class="img-fluid border rounded-3 shadow-lg mb-4" alt="Example image" width="700" height="500" loading="lazy">
</div>
</div>
</section>
<div class="divider"></div>
<div class="container col-xl-10 col-xxl-8 pt-2">
<div class="row align-items-center g-5 py-5">
<section class="col-lg-7 text-center text-lg-start">
<h2 class="display-4 fw-bold lh-1 mb-3">Feedback</h2>
<p class="lead col-lg-10">Below is an example form built entirely with Bootstrap’s form controls. Each required form group has a validation state that can be triggered by attempting to submit the form without completing it.</p>
<div class="btn-group" role="group" aria-label="Basic mixed styles example">
<button type="button" class="btn btn-dark">B</button>
<button type="button" class="btn btn-danger">R</button>
<button type="button" class="btn btn-warning">D</button>
</div>
</section>
<div class="col-10 mx-auto col-lg-5">
<form class="p-5 border rounded-3 bg-light">
<div class="form-floating mb-3">
<input type="email" class="form-control" id="floatingInput" placeholder="name@example.com">
<label for="floatingInput">Name</label>
</div>
<div class="form-floating mb-3">
<input type="password" class="form-control" id="floatingPassword" placeholder="Password">
<label for="floatingPassword">Nachricht</label>
</div>
<button class="w-100 btn btn-lg btn-primary" type="submit">Abschicken</button>
</form>
</div>
</div>
</div>
<div class="divider"></div>
<div class="container">
<div class="d-flex justify-content-center py-3">
<ul class="nav nav-pills">
<li class="nav-item"><a href="#" class="nav-link">Hund</a></li>
<li class="nav-item"><a href="#" class="nav-link">Katze</a></li>
<li class="nav-item"><a href="#" class="nav-link">Maus</a></li>
<li class="nav-item"><a href="#" class="nav-link">Vogel</a></li>
</ul>
</div>
</div>
<div class="divider"></div>
<div class="container my-5">
<div class="row p-4 pb-0 pe-lg-0 pt-lg-5 align-items-center rounded-3 border shadow-lg">
<section class="col-lg-7 p-3 p-lg-5 pt-lg-3">
<h2 class="display-4 fw-bold lh-1">Border hero with cropped image and shadows</h2>
<p class="lead">Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.</p>
<div class="d-grid gap-2 d-md-flex justify-content-md-start mb-4 mb-lg-3">
<button type="button" class="btn btn-primary btn-lg px-4 me-md-2 fw-bold">Primary</button>
<button type="button" class="btn btn-outline-secondary btn-lg px-4">Default</button>
</div>
</section>
<div class="col-lg-4 offset-lg-1 p-0 position-relative overflow-hidden shadow-lg">
<div class="position-lg-absolute top-0 left-0 overflow-hidden">
<img class="d-block rounded-lg-3" src="https://getbootstrap.com/docs/5.0/examples/heroes/bootstrap-docs.png" alt="" width="720">
</div>
</div>
</div>
</div>
<div class="divider"></div>
<div class="container px-4 pt-2 my-5">
<div class="row p-2 pb-0 pe-lg-0 align-items-center rounded-3 border shadow-lg">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Start</a></li>
<li class="breadcrumb-item"><a href="#">Kategorie</a></li>
<li class="breadcrumb-item active" aria-current="page">Section</li>
</ol>
</nav>
<h2 class="display-4 fw-bold lh-1 mb-3">Section</h2><hr>
<p class="lead">Siehe dir den <span class="badge bg-secondary">badge</span> <code>Quelltext</code> an, was hier für ein Aufriss gemacht wird, damit diese Box hier so Aussieht, wie sie Aussieht.</p>
</div>
</div>
<div class="divider"></div>
<div class="container px-4 pt-2 my-5">
<div class="row py-5">
<aside class="col-md-4"><div class="card">
<img src="https://unsplash.it/410" class="card-img-top" alt="...">
<div class="card-body">
<h3 class="card-title">Box 1</h3>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<button type="button" class="btn btn-primary" data-bs-toggle="tooltip" data-bs-placement="right" title="Info">Hover me</button>
</div>
</div>
</aside>
<aside class="col-md-4"><div class="card">
<img src="https://unsplash.it/420" class="card-img-top" alt="...">
<div class="card-body">
<h3 class="card-title">Box 2</h3>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<button type="button" class="btn btn-primary" data-bs-toggle="tooltip" data-bs-placement="right" title="Info">Hover me</button>
</div>
</div>
</aside>
<aside class="col-md-4"><div class="card">
<img src="https://unsplash.it/430" class="card-img-top" alt="...">
<div class="card-body">
<h3 class="card-title">Box 3</h3>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<button type="button" class="btn btn-primary" data-bs-toggle="tooltip" data-bs-placement="right" title="Info">Hover me</button>
</div>
</div>
</aside>
</div>
</div>
<footer class="bg-dark p-4 text-white text-center">
<nav class="nav d-flex justify-content-between">
<a class="p-2 link-secondary" href="#">World</a>
<a class="p-2 link-secondary" href="#">U.S.</a>
<a class="p-2 link-secondary" href="#">Technology</a>
<a class="p-2 link-secondary" href="#">Design</a>
<a class="p-2 link-secondary" href="#">Culture</a>
<a class="p-2 link-secondary" href="#">Business</a>
<a class="p-2 link-secondary" href="#">Top</a>
</nav>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
@import url(https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css);
@import url(https://use.fontawesome.com/releases/v5.15.3/css/all.css);
@import url(https://fonts.googleapis.com/css?family=Poiret+One|Anton|Roboto:100,400);
h1, h2, h3 {
font-family: 'Poiret One';
font-size: calc(1.2rem + 1.4vmin);
font-weight: bold;
}
a {
text-decoration: none;
}
.navbar-toggler:focus {
box-shadow: none;
}
.navbar-toggler {
border: 0;
}
.divider {
height: 3rem;
background-color: rgba(0, 0, 0, .1);
border: solid rgba(0, 0, 0, .15);
border-width: 1px 0;
box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
}
// tooltip
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
})
Also see: Tab Triggers