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.
<link href="https://fonts.googleapis.com/css?family=Orbitron" rel="stylesheet">
<body>
<ul class="nav nav-pills">
<li>
<a>Chiang Rai Bears</a>
</li>
<li class="pull-right">
<a class="nav-link">Contact</a>
</li>
<li class="pull-right">
<a class="nav-link">Schedule</a>
</li>
<li class="pull-right">
<a class="nav-link">News</a>
</li>
<li class="pull-right">
<a class="nav-link">Team</a>
</li>
</ul>
<div id="pageOne" class='page current'>
<div id='bearContainer'>
<img id='bearsLogo' src='https://lh3.googleusercontent.com/jWQkqZ-g2WV6pw8_Pjj3RzdeJ6Y8gpdtmBflAcsTGBgOtemnMmxu93tBHOmt4DE0ETC0AVftCLUt839yeaKJkZ4WmOIvJ6VHDXVD6_A4BOxDkn9ILFskekeWzDu40r1dEPzjTkRaz9p9sB_X_JH0x6rgWNNCOHJ3p7jDTbAF9VqBnvApib_r6AZXm6YDoNyW2SopUV3YM755t4VsyDqs_DS6pHBUTGIasRuHAn2AUM7qqxxpm7BmzobiMz0wlahcHK3A7z440iiD3fxKNPGdhP7EBBMglhU-2hUAu_Dz8nKF_sMtlrifKSo5Yr6c2AorrloDpIasSQIZjq-UkjcR75rYQHZ4toHmlnZ95XYwq3DpWyhxAxzsMR067l-vHELCD6o1Qo2yN-20POf0iTrpHA0bFt17732ce48rxYrhnjpivm5fA3oX_gueMdiUdjt0HUIwxGctNvCs8TFcOJicNaU7CNEbQijc6YSo9TSSvfWpsEbDCxV-pQtgArcbeWiKOUdWoFab5Iv7sHiR-EXCzewpgK-f2N2UHlNhBSYkHO-gX7AaPjYGXC8jpEdgDniDWXvO3lA2myPk154UQHtoWr-zykcLPrBbMegAhnBFtmUpJX3bop0ZPzg4EJ_5ZfAKiLdQ-zzrhEF-jwLmTYb3MWVMW3nFyYZ0lH0=w461-h662-no'>
</div>
<h1 class='main-title'>For King and Country</h1>
</div>
<div id='pageFive' class="page">
<h1 class='titles2'>Contact</h1>
<div class="midphoto">
<img src="http://res.cloudinary.com/ivanms1/image/upload/c_scale,h_700/v1510705886/23600255_10155628538050907_1840303242_o_glolcp.jpg"class="contactPic">
</div>
<p class='contact'>CEO <br> Lonny Levi <br> 0800 741 584</p>
</div>
<div id='pageFour' class="page">
<h1 class='titles2'>Schedule</h1>
<div class="midphoto">
<img src="http://res.cloudinary.com/ivanms1/image/upload/c_scale,w_700/v1510093441/ChiangRaiBears/23360882_10155605571270907_763037140_n.jpg"class="photo">
</div>
<p class="par">Sunday practices from 5-6pm at Chiang Rai Rajabaht University-ring 0800 741 584 for more information. Chiang Mai Rugby League annual fixture in October/November 2018 (TBC) join the conversation on our facebook group page (Chiang Rai Bears). Chiang Rai Rugby League tournament Feb 2018 (TBC ) join the conversation on our facebook group page (Chiang Rai Bears).</p>
</div>
<div id='pageThree' class="page">
<h1 class='titles'>News</h1>
<div id="newsphoto" class="midphoto">
<img class="photo" src="http://res.cloudinary.com/ivanms1/image/upload/c_scale,w_700/v1510093438/ChiangRaiBears/23361101_10155605571630907_732096014_n.jpg">
</div>
<p class="par">The Bears had their first match versus a strong Chiang Mai squad on Thursday 2nd November. We won the match 12-10 and people were surprised by the outcome-we were too. The team are happy with the win and gives the players confidence moving forward. Chiang Rai Rugby/League tournament in February 2018 at Chiang Rai Rajabaht University. We are planning on doing a tournament in Chiang Rai as a step to develop the game but also to showcase it to the community.</p>
</div>
<div id='pageTwo' class="page">
<h1 class='titles'>Team</h1>
<div class="midphoto">
<img class="photo" src="http://res.cloudinary.com/ivanms1/image/upload/c_scale,w_700/v1510093431/ChiangRaiBears/23283420_10155605571375907_70421381_n.jpg">
</div>
<p class="par">Welcome to the Chiang Rai Northern Bears Rugby/League club. We are about developing rugby/league in Chiang Rai and remote places in Northern Thailand. We are about family and community so join us as we take another step into the new year 2018! The Bears welcome all players so read more about practices on our news page. The Bears!</p>
</div>
</body>
html,
body {
font-family: 'Orbitron', sans-serif;
background-image: url('https://images.unsplash.com/photo-1503318759574-b9dc482cdf36?dpr=1&auto=compress,format&fit=crop&w=1502&h=&q=80&cs=tinysrgb&crop=');
background-repeat: no-repeat;
background-position: center top;
}
ul {
background-color: #ff5d1f;
}
.nav-pills a {
color: black;
font-size: 1.5vw;
}
.nav-pills a:hover {}
#pageOne {
background-color: transparent;
}
#bearContainer {
margin: 2% auto;
background-color: transparent;
text-align: center;
}
#bearsLogo {
width: 24%;
border: solid 4px black;
border-radius: 10%;
margin: 0 auto;
}
.main-title {
width: 60%;
margin: 0 auto;
;
text-align: center;
background-color: white;
font-size: 4vw;
opacity: 0.9;
border-radius: 10%;
border: solid 4px black;
}
.page {
display: none;
}
.page.current {
display: block;
}
.titles {
width: 15%;
margin: 1% auto;
text-align: center;
background-color: white;
font-size: 4vw;
opacity: 0.9;
border-radius: 10%;
border: solid 4px black;
}
.titles2 {
width: 23%;
margin: 1% auto;
text-align: center;
background-color: white;
font-size: 4vw;
opacity: 0.9;
border-radius: 10%;
border: solid 4px black;
}
.par {
width: 80%;
margin: 1% auto;
text-align: center;
background-color: white;
font-size: 1.2vw;
opacity: 0.9;
border-radius: 10%;
}
.midphoto {
margin: 2% auto;
text-align: center;
}
.photo {
width: 35%;
border: solid 5px black;
border-radius: 10%;
margin: 0 auto;
}
.contact {
width: 15%;
margin: 1% auto;
text-align: center;
background-color: white;
font-size: 1.5vw;
opacity: 0.9;
border-radius: 10%;
}
.contactPic{
width: 20%;
border: solid 4px black;
border-radius: 10%;
margin: 0 auto;
}
@media only screen and (max-width: 600px){
.titles2{
font-size: 9.5vw;
width: 53%;
margin-top: 4%;
}
.titles{
font-size: 9.5vw;
width: 33%;
margin-top: 4%;
}
.par{
font-size: 3.5vw;
width: 90%;
}
.photo{
width: 90%;
}
#bearsLogo{
width: 60%;
margin-top: 4%;
}
.main-title{
width: 90%;
font-size: 8vw;
}
.nav-pills a{
font-size: 2.3vw;
}
.contact{
font-size: 4.5vw;
width: 40%;
}
.contactPic{
width: 60%;
}
}
$(function(){
$('ul li').click(function(){
speed=200;
i = $(this).index();
$('.page.current').fadeOut(speed, function(){
$(this).removeClass('current');
$('.page').eq(i).fadeIn(speed).addClass('current');
});
});
});
Also see: Tab Triggers