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.
<div class="container-fluid">
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Yet Another Bootstrap Portfolio</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a href="#about">About</a></li>
<li><a href="#portfolio">Portfolio</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="col-xs-12 splashPage">
<div class="splashPage-text">
<p class="text-center main-line">Oh Snap!</p>
<p class="text-center">It's a portfolio page made with Bootstrap!</p>
</div>
</div>
<div class="col-xs-12 section" id="about">
<div class="center-content">
<h2>About Me</h2>
<p>This would be the part where you write a little something about yourself. Don't be shy, let the world know what you're made of! A little embelishment is fine, just don't go overboard. Trust me, you don't want to oversell yourself as a "high-performance, challenge-seeking individual with the body to rival that of Adonis.</p>
<img src="https://pbs.twimg.com/profile_images/1237550450/mstom_400x400.jpg" alt="A space where the portfolio owner's picture can go. Currently set to a picture of Tom Anderson, creator of MySpace" class="profile-image">
<h3>I specialize in</h3>
<div class="icon-container">
<i class="devicon-html5-plain"></i>
<i class="devicon-css3-plain"></i>
<i class="devicon-javascript-plain"></i>
</div>
</div>
</div>
<div class="col-xs-12 section" id="portfolio">
<div class="center-content">
<h2>Portfolio</h2>
<div class="project-container">
<img src="https://gustavoguarino.com/projects/bootstrap-portfolio/paint-splatter.jpg" alt="Project screenshot. Placeholder courtesy of https://wallpaperset.com/">
<p>A Study on Paint Splatter</p>
</div>
<div class="project-container">
<img src="https://gustavoguarino.com/projects/bootstrap-portfolio/business-headphones.jpg" alt="Project screenshot. Placeholder courtesy of https://www.pexels.com">
<p>Headphones Render</p>
</div>
<div class="project-container">
<img src="https://gustavoguarino.com/projects/bootstrap-portfolio/architecture.jpg" alt="Project screenshot. Placeholder courtesy of https://www.pixelstalk.net/">
<p>Architectual Design</p>
</div>
<div class="project-container">
<img src="https://gustavoguarino.com/projects/bootstrap-portfolio/table.jpg" alt="Project screenshot. Placeholder courtesy of http://www.wallpapers4u.org/">
<p>Shot of my Table, 2004</p>
</div>
</div>
</div>
<div class="col-xs-12 section" id="contact">
<div class="center-content">
<h2>Contact</h2>
<p>Hoping for someone to reach out to you? Instead of simply dropping your email address somewhere in the text, why not have a form that can be filled out? It gives your page a nice touch, and if set up properly, can actually help keep your inbox neater.</p>
<p>That being said, you will still want to have your email address typed out so that people can easily grab it for whatever they may need. Hopefully it's to reach out to you, and not to scrape your information to send you spam. Either way, simply plonking that somewhere will do in a pinch, like so: <a href="mailto:yourname@youremailserver.com">yourname@youremailserver.com</a></p>
<form>
<div class="form-group row">
<label for="first-name" class="sr-only">First Name</label>
<input class="form-control" type="text" placeholder="First name" id="first-name">
</div>
<div class="form-group row">
<label for="last-name" class="sr-only">Last Name</label>
<input class="form-control" type="text" placeholder="Last name" id="last-name">
</div>
<div class="form-group row">
<label for="email" class="sr-only">Email Address</label>
<input class="form-control" type="text" placeholder="Email Address" id="email" required>
</div>
<div class="form-group row">
<label for="message" class="sr-only">Your Message</label>
<textarea class="form-control" placeholder="Your message" id="message" rows="7" required></textarea>
</div>
<button type="submit" class="btn btn-primary">Send</button>
</form>
</div>
</div>
<footer>
<a href="#"><i class="fa fa-facebook" aria-hidden="true"></i></a>
<a href="#"><i class="fa fa-twitter" aria-hidden="true"></i></a>
<a href="#"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
</footer>
</div>
h2 {
display: block;
text-align: center;
width: 60%;
margin: 0.3em auto;
padding-bottom: 0.25em;
border-bottom: 3px dashed #ff9f1c;
font-family: "Passion One", sans-serif;
font-size: 3.5em;
color: #FDFFFC;
}
p {
color: #011627;
font-family: "Overpass", sans-serif;
display: block;
width: 90%;
margin: 1em auto 2em;
font-size: 1.35em;
text-align: justify;
}
.container-fluid {
padding: 0;
}
.navbar-default {
margin-bottom: 0;
background: #011627;
border: none;
font-size: 1.3em;
}
.navbar-default .navbar-brand {
color: whitesmoke !important;
font-family: "Passion One", sans-serif;
}
.navbar-default li a {
color: #ff9f1c !important;
font-family: "Overpass", sans-serif;
}
.navbar-default li:hover {
background: #c3e3fd;
}
.navbar-default li:hover a, footer a:hover i {
background: #c3e3fd;
color: #011627 !important;
}
.navbar-default .navbar-toggle {
border-color: #ff9f1c;
border-radius: 50%;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #ff9f1c;
}
.fixed {
position: fixed;
}
.splashPage {
min-height: 450px;
height: 70vh;
max-height: 1080px;
position: relative;
background: #3e5358 url('http://wallpapercave.com/wp/0dWI3hG.jpg') no-repeat fixed center center !important;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.splashPage-text {
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
min-height: 190px;
height: 20vh;
width: 100%;
min-width: 400px;
font-family: "Passion One", sans-serif;
}
.splashPage-text .main-line {
margin: 0;
color: white;
font-size: 8em;
text-shadow: 0 4px 1px #503c28;
}
.splashPage-text p {
font-family: "Passion One", sans-serif;
margin: 0;
color: lightgray;
font-size: 3em;
text-shadow: 0 2px 2px #46321e;
width: 100%;
}
.section {
padding: 20px 0;
min-height: 700px;
}
.section:nth-child(odd) {
background: #2ec4b6;
}
.section:nth-child(even) {
background: #626868;
}
h3 {
display: block;
text-align: center;
width: 60%;
padding-bottom: 0.25em;
font-family: "Passion One", sans-serif;
color: #FDFFFC;
font-size: 2.5em;
margin: 1em auto 0.45em;
}
.profile-image {
display: block;
margin: 0 auto;
border-radius: 100%;
width: 200px;
}
.icon-container {
position: relative;
width: 100%;
height: 100px;
text-align: center;
}
.icon-container i {
position: relative;
font-size: 100px;
margin: 0 20px;
color: #ff9f1c;
opacity: 0;
}
.icon-container i:hover {
color: #ffca82;
}
.slideIn {
animation-name: slideIn;
animation-duration: .8s;
animation-fill-mode: forwards;
}
@keyframes slideIn {
from {
bottom: -100;
opacity: 0;
}
to {
bottom: 0;
opacity: 1;
}
}
.project-container {
position: relative;
margin: 0 auto 30px;
background: #ff9f1c;
}
.project-container img {
max-height: 100%;
max-width: 100%;
height: auto;
width: auto;
margin: 0 auto;
display: block;
}
.project-container p {
pointer-events: none;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 80%;
font-size: 3em;
text-align: center;
font-family: "Overpass", sans-serif;
display: none;
}
.project-container:hover img {
opacity: .5;
transition: opacity .25s;
}
.project-container:hover p {
display: block;
}
form {
border-radius: 15px;
background: #626868;
padding: 20px;
width: 450px;
margin: 1.5em auto;
}
form .form-group {
margin: 0;
margin-bottom: 0.75em;
}
form input {
border: none;
}
form textarea {
resize: none;
}
footer {
background: #011627;
width: 100%;
padding-right: 50px;
text-align: right;
}
footer i {
color: #ff9f1c;
padding: 10px 20px;
font-size: 25px !important;
}
.center-content {
max-width: 900px;
margin: 0 auto;
}
$( document ).ready(function() {
$(window).scroll(function() {
var scroll = $(window).scrollTop();
var triggerPoint = $(".icon-container").position();
if (scroll >= triggerPoint.top - 200) {
$("i").addClass("slideIn");
}
});
});
Also see: Tab Triggers