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.
<!-- Navigation Bar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" id="btn-toggle">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">[FCC] Tribute Page</a>
</div>
<div class="collapse navbar-collapse" id="my-navbar">
<ul class="nav navbar-nav navbar-right">
<li id="menu-about" class="my-menu active"><a href="#about">About</a></li>
<li id="menu-career" class="my-menu"><a href="#career">Career</a></li>
<li id="menu-qoute" class="my-menu"><a href="#qoute">Qoutes</a></li>
</ul>
</div>
</div>
</nav>
<!-- Content -->
<div class="container">
<!-- Header -->
<div class="row">
<div class="jumbotron" id="jumbotron-top">
<h1>Brendan Eich</h1>
<p>Founder & CEO, Brave Software. Created JavaScript. Co-founded Mozilla and Firefox.</p>
</div>
</div>
<!-- About -->
<div class="row" id="about">
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
<img id="img-profile" alt="Brendan Eich's Profile Picture" class="img-responsive" src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d1/Brendan_Eich_Mozilla_Foundation_official_photo.jpg/480px-Brendan_Eich_Mozilla_Foundation_official_photo.jpg">
</div>
<div class="col-xs-12 col-sm-8 col-md-8 col-md-8">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Basic Info</h3>
</div>
<div class="panel-body">
<ul>
<li><strong>Born:</strong> July 4, 1961, <a href="https://en.wikipedia.org/wiki/Pittsburgh,_Pennsylvania">Pittsburgh, Pennsylvania</a>, U.S</li>
<li><strong>Residence:</strong> San Francisco Bay Area</li>
<li><strong>Education:</strong> <a href="https://en.wikipedia.org/wiki/University_of_Illinois_at_Urbana-Champaign">University of Illinois at Urbana-Champaign</a>, <a href="https://en.wikipedia.org/wiki/Santa_Clara_University">Santa Clara University</a></li>
<li><strong>Known for:</strong> JavaScript</li>
<li><strong>Website:</strong> <a href="https://brendaneich.com">brendaneich.com</a></li>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Social Links</h3>
</div>
<div class="panel-body">
<ul>
<li><strong>Github:</strong> <a href="https://github.com/BrendanEich">https://github.com/BrendanEich</a></li>
<li><strong>Twitter:</strong> <a href="https://twitter.com/brendaneich">https://twitter.com/brendaneich</a></li>
<li><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/brendaneich/">https://www.linkedin.com/in/brendaneich/</a></li>
<li><strong>Mastodon:</strong> <a href="https://mastodon.social/@BrendanEich">https://mastodon.social/@BrendanEich</a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- Career -->
<div class="row" id="career">
<div class="jumbotron">
<h2>Here are milestones of Brendan Eich's career:</h2>
<h3>Early life</h3>
<ul>
<li>Brendan Eich grew up in Palo Alto.</li>
<li>He attended Ellwood P. Cubberley High School, graduating in the class of 1979.</li>
<li>Eich received his bachelor's degree in mathematics and computer science at Santa Clara University.</li>
<li>He received his master's degree in 1985 from the University of Illinois at Urbana-Champaign.</li>
</ul>
<h3>Netscape and JavaScript</h3>
<ul>
<li>He started work at Netscape Communications Corporation in April 1995.</li>
<li>He completed the first version of a programming language in ten days in order to accommodate the Navigator 2.0 Beta release schedule.</li>
<li>The language was called Mocha, but renamed LiveScript in September 1995 and later JavaScript in the same month.</li>
</ul>
<h3>Mozilla</h3>
<ul>
<li>In early 1998, Eich co-founded the Mozilla project with Mitchell Baker, creating the website mozilla.org that was meant to manage open-source contributions to the Netscape source code. He served as Mozilla's chief architect.</li>
<li>AOL bought Netscape in 1999. After AOL shut down the Netscape browser unit in July 2003, Eich helped spin out the Mozilla Foundation.</li>
<li>In August 2005, Eich became CTO of the newly founded Mozilla Corporation, meant to be the Mozilla Foundation's for-profit arm.</li>
<li>Eich continued to "own" the Mozilla SpiderMonkey module, its JavaScript engine, until he passed on the ownership of it in 2011.</li>
<li>On March 24, 2014, Eich was promoted to CEO of Mozilla Corporation.</li>
<li>On April 3, 2014, Eich stepped down as CEO and resigned from working at Mozilla.</li>
</ul>
<h3>Brave Software</h3>
<ul>
<li>Eich is the CEO of Brave Software, an Internet security company which has raised $2.5 million in early funding from angel investors.</li>
<li>The company's co-founder is Brian Bondy, who worked on Firefox and Khan Academy. The company's employees include Marshall Rose, a network protocol engineer, and Yan Zhu, who worked on SecureDrop and Tor.</li>
<li>On January 20, 2016, the company released developer versions of its open-source Brave web browser, which blocked ads and trackers and included a micropayments system to offer users a choice between viewing selected ads or paying websites not to display them. A recent update added inbuilt integration of 1Password and LastPass password managers.</li>
</ul>
<h3>Basic Attention Token</h3>
<ul>
<li>Eich is also the founder of Basic Attention Token (BAT), a "utility token based on the Ethereum technology that can also be used as a unit of account between advertisers, publishers, and users in a new, blockchain-based digital advertising and services platform".</li>
<li>BAT launched its ICO on May 31, 2017 raising $35 million in just 30 seconds.</li>
</ul>
<p>If you have time, you should read more about Brendan Eich at <a href="https://en.wikipedia.org/wiki/Brendan_Eich">Wikipedia</a> (<small>the <a href="https://en.wikipedia.org/wiki/File:Brendan_Eich_Mozilla_Foundation_official_photo.jpg">image</a> is licensed under the <a href="https://en.wikipedia.org/wiki/en:Creative_Commons">Creative Commons</a> <a href="https://creativecommons.org/licenses/by-sa/3.0/deed.en">Attribution-Share Alike 3.0 Unported license</a></small>).</p>
</div>
</div>
<!-- Qoutes -->
<div class="row" id="qoute">
<h2 class="text-center" id="txt-qoute-title">Brendan Eich's qoutes</h2>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">List of qoutes:</h3>
</div>
<div class="panel-body">
<ol>
<li>Always bet on JavaScript.</li>
<li>If the web can be evolved to include the missing APIs and have better performance, [developers] won't need to go
beyond the web.</li>
<li>JS had to "look like Java" only less so, be Java’s dumb kid brother or boy-hostage sidekick. Plus, I had to be done
in ten days or something worse than JS would have happened.</li>
<li>We're adding a lot of fun features.</li>
<li>It's been over ten years, hard to believe. It was the Rodney Dangerfield of languages.</li>
<li>It's time to get back to innovating in the browser space.</li>
<li>Why the long freeze in JavaScript development? A lot of it had to do with the long freeze on browsers due to the
IE [Internet Explorer] takeover.</li>
<li>We're going to learn from Python. JavaScript is pretty close to Python.</li>
</ol>
</div>
</div>
</div>
<!-- Footer -->
<div class="row" id="my-footer">
<p class="text-center">Written and coded by <a href="http://about.phamvanlam.com/">Lam Pham</a>. Visit me on <a href="https://completejavascript.com/gioi-thieu/">Complete JavaScript</a>.</p>
</div>
</div>
body {
font-family: Helvetica, Arial, sans-serif;
}
a {
word-wrap: break-word;
}
.container .jumbotron {
border-radius: 0px;
margin-bottom: 0px;
}
#jumbotron-top{
padding-top: 70px;
}
#about {
background-color: cadetblue;
padding-top: 15px;
}
#img-profile {
border: 10px solid white;
border-radius: 50%;
margin: 0 auto;
margin-bottom: 15px;
}
#qoute {
background-color: cadetblue;
padding: 15px 30px;
}
#txt-qoute-title {
color: white;
padding-bottom: 15px;
}
#my-footer {
background-color: #eeeeee;
padding: 15px;
}
$(document).ready(function(){
let timer;
let menuClicked = false;
// Open link all links in a new tab, except links with '#' in the beginning
$("a:not([href^='#'])").attr("target", "_blank");
// Navigation Bar Handling
$(".my-menu").click(function(){
menuClicked = true;
activateMenu(this);
$("#my-navbar").slideUp();
});
$("#btn-toggle").click(function(){
$("#my-navbar").slideToggle();
});
// Update menu while scrolling
$(window).scroll(function(){
if(timer) {
window.clearTimeout(timer);
}
timer = window.setTimeout(handleScrollEvent, 100);
});
// Smooth scrolling
$("a[href*='#']:not([href='#'])").click(function () {
let target = $(this).attr("href");
$('html,body').stop().animate({
scrollTop: $(target).offset().top - 32 // First element's marginTop = 32px
}, 1000);
event.preventDefault();
});
function handleScrollEvent() {
if (!menuClicked) {
let about = $('#about');
let career = $('#career');
let qoute = $('#qoute');
if(isInViewPort(about) && !about.hasClass("active")) {
activateMenu($('#menu-about'));
setHashLocation('#about');
}
else if(isInViewPort(career) && !career.hasClass("active")) {
activateMenu($('#menu-career'));
setHashLocation('#career');
}
else if(isInViewPort(qoute) && !qoute.hasClass("active")) {
activateMenu($('#menu-qoute'));
setHashLocation('#qoute');
}
} else {
menuClicked = false;
}
}
function setHashLocation(id) {
var scrollmem = $('html,body').scrollTop();
window.location.hash = id;
$('html,body').scrollTop(scrollmem);
}
function activateMenu(menuItem){
$(menuItem).parent().children().removeClass("active");
$(menuItem).addClass("active");
}
function isInViewPort(element){
let elementTop = $(element).offset().top;
let elementBottom = elementTop + $(element).outerHeight();
let viewPortTop = $(window).scrollTop();
let viewPortBottom = viewPortTop + $(window).height();
return elementBottom > viewPortTop && elementTop < viewPortBottom;
}
});
Also see: Tab Triggers