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 id="container">
<header>
<hgroup>
<h1><a href="#">CSS3 Ribbon Menu</a></h1>
<h2><a href="#">Featuring 3D Buttons</a></h2>
</hgroup>
</header>
<div id="menu">
<nav>
<ul>
<span class="navbefore"></span>
<li class="menu-item"><a href="#">About</a></li>
<li class="menu-item"><a href="#">Facebook</a></li>
<li class="menu-item"><a href="#">Twitter</a></li>
<li class="menu-item"><a href="#">Portfolio</a></li>
<li class="menu-item"><a href="#">Contact</a></li>
<li class="menu-item noHover"><a href="#">.</a></li>
<span class="navafter"></span>
</ul>
</nav>
</div>
</div>
/*
Scroll down to see NAV CSS.
Pure CSS3 Ribbon Menu
http://stephenbelovarich.com
v1.5 | 20130308
This ribbon menu is different than most. It includes a cool 3D hover effect that can also be made :active, making it look pressed down.
Best viewed in Webkit. Theres a bug in Firefox, probably IE but haven't checked yet.
v1.5
There is still an issue with a space between the last li and the .navafter span in some browsers. Trying to find a CSS only solution. Any takers?
Styled last <li> in list so that it is hidden, has same color as ribbon. This solves a problem where the right most li breaks the layout on hover. This workaround also makes the CSS3 Ribbon Menu free of jQuery.
v1.1
fixed FF13 and iOS bug that dropped .navafter below the ribbon, good for keeping the 3D illusion.
removed box-shadow from nav ul, was making a hairline horizontal impression on the top of each pressed down nav element.
added gradients to .navbefore and .navafter to emphasize their depth against the background cut out ends
removed reset, b/c codepen includes it now
v 1.0
CSS3 Transforms! The buttons are just begging to be animated.
CSS3 Gradients! Hover over a button to see what I mean.
Depth while hovering is created using pseudo elements, transform and gradients.
When the nav is directed to content on a single page layout on iPad the default behavior keeps touched buttons pressed down. You could make an active pseudo class to keep the active button pressed when the user is viewing content.
Lots of pseudo elements! Whoo hoo! Which means older versions of IE can't handle it. But then again, it says CSS3 Ribbon Menu
Eric Meyer's RESET used, just b/c its always in my CSS so included it here to make sure everything works. *REMOVED in v1.1
Well commented so you can learn how it was made.
*/
/*------------------------------------*\
MAIN
\*------------------------------------*/
/* GO! */
body {
font: 14px "Helvetica", Helvetica, Arial, sans-serif;
color: #000;
}
a:link, a:visited {
color: #222;
text-decoration: none;
}
a:hover {
color: #666;
text-decoration: none;
}
h1, h2, h3, h4, h5 {
font-size: 2.2em;
}
#container {
width:100%;
height:auto;
padding-bottom:320px;
background: #f9f9f9; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPHJhZGlhbEdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNzUlIj4KICAgIDxzdG9wIG9mZnNldD0iMjYlIiBzdG9wLWNvbG9yPSIjZjlmOWY5IiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2JmYmZiZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9yYWRpYWxHcmFkaWVudD4KICA8cmVjdCB4PSItNTAiIHk9Ii01MCIgd2lkdGg9IjEwMSIgaGVpZ2h0PSIxMDEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==);
background: -moz-radial-gradient(center, ellipse cover, #f9f9f9 26%, #bfbfbf 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(26%,#f9f9f9), color-stop(100%,#bfbfbf)); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, #f9f9f9 26%,#bfbfbf 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, #f9f9f9 26%,#bfbfbf 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, #f9f9f9 26%,#bfbfbf 100%); /* IE10+ */
background: radial-gradient(center, ellipse cover, #f9f9f9 26%,#bfbfbf 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#bfbfbf',GradientType=1 ); /* IE6-8 fallback on horizontal gradient */
}
header {
width: 100%;
height: 10%;
clear:both;
}
header hgroup {
width: 75.2%;
margin: 0 auto;
text-align: center;
padding-top: 3%;
padding-bottom: 3%;
}
hgroup h1, hgroup h2 {
}
hgroup h1 {
font-size: 3em;
}
hgroup h2 {
font-size: 2em;
}
header a:link, header a:visited {
}
/* NAV */
#menu {
clear: both;
display: block;
position:relative;
width: 1000px; /* fixed width allows for empty area in ribbon to be correctly sized */
height:56px;
margin: 0 auto; /* for fluid layout margin on either side */
z-index:1;
background: transparent;
}
/* following after and before is for the nav container #menu to give it the cut end look */
#menu:after, #menu:before {
margin-top:0.5em;
content: "";
border:1.8em solid #BF0300; /* Old browsers */
float:left;
position: relative;
margin-top:14px;
z-index:0;
}
#menu:after {
position:relative;
top: 0px;
left:-8px;
float:right;
border-right-color:transparent;
}
#menu:before {
left:8px;
border-left-color:transparent;
}
/* actual navigation */
nav {
width: 900px;
height:56px;
position:relative;
float:left;
top:0;
left:0;
/*-moz-box-shadow: -6px 8px 6px -6px rgba(0,0,0,0.4);
-webkit-box-shadow: -6px 8px 6px -6px rgba(0,0,0,0.4);
box-shadow: -6px 8px 6px -6px rgba(0,0,0,0.4);
dropped due to error on iOS, fix soon */
z-index:1;
}
nav ul {
font-size: 16px;
display:block;
list-style: none;
width:auto;
margin: 0;
padding-left: 0;
overflow-y: visible;
}
/* So that the hover effect can retain transparency, the enitre nav cannot have a background.
these classes style spans on either side left & right of the ul list to keep the ribbon intact */
.navbefore {
position:relative;
display:block;
width: 48px !important; /* must equal nav li:first-child margin-left */
height: 56px;
background: rgb(170,0,0); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2FhMDAwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjU4JSIgc3RvcC1jb2xvcj0iI2JmMDMwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9Ijk5JSIgc3RvcC1jb2xvcj0iI2JmMDMwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
background: -moz-linear-gradient(left, rgba(170,0,0,1) 0%, rgba(191,3,0,1) 58%, rgba(191,3,0,1) 99%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(170,0,0,1)), color-stop(58%,rgba(191,3,0,1)), color-stop(99%,rgba(191,3,0,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(170,0,0,1) 0%,rgba(191,3,0,1) 58%,rgba(191,3,0,1) 99%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(170,0,0,1) 0%,rgba(191,3,0,1) 58%,rgba(191,3,0,1) 99%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(170,0,0,1) 0%,rgba(191,3,0,1) 58%,rgba(191,3,0,1) 99%); /* IE10+ */
background: linear-gradient(to right, rgba(170,0,0,1) 0%,rgba(191,3,0,1) 58%,rgba(191,3,0,1) 99%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#aa0000', endColorstr='#bf0300',GradientType=1 ); /* IE6-8 */
z-index:1;
float:left;
}
.navafter {
position: relative;
display:block;
float:left;
width: 252px; /* must compensate for width of ul element, this width is changed via jQuery to compensate for hover */
height: 56px;
/*margin-left:548px;*/
background: rgb(191,3,0); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2JmMDMwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjgzJSIgc3RvcC1jb2xvcj0iI2JmMDMwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNhYTAwMDAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(left, rgba(191,3,0,1) 0%, rgba(191,3,0,1) 83%, rgba(170,0,0,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(191,3,0,1)), color-stop(83%,rgba(191,3,0,1)), color-stop(100%,rgba(170,0,0,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(191,3,0,1) 0%,rgba(191,3,0,1) 83%,rgba(170,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(191,3,0,1) 0%,rgba(191,3,0,1) 83%,rgba(170,0,0,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(191,3,0,1) 0%,rgba(191,3,0,1) 83%,rgba(170,0,0,1) 100%); /* IE10+ */
background: linear-gradient(to right, rgba(191,3,0,1) 0%,rgba(191,3,0,1) 83%,rgba(170,0,0,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bf0300', endColorstr='#aa0000',GradientType=1 ); /* IE6-8 */
z-index:1;
}
/* since the #menu container uses before and after to style the ends of the ribbon,
i decided to make the folds on either side of the nav using :before and :after
you could do this by styling the content, but thought this approach to be easier */
nav ul .navbefore:before, nav ul .navafter:after
{
content: '';
position: absolute;
border-style: solid;
border-color: transparent;
bottom: -8px;
}
nav ul .navbefore:before
{
border-width: 0 9px 9px 0;
border-right-color: #5E0100;
left: 0px;
}
nav ul .navafter:after {
border-width: 0 0 8px 8px;
border-left-color: #5E0100;
right:0;
}
/* finally, we style a list element */
nav li {
float: left;
position: relative;
z-index:44;
-moz-transform: translate(0px, 0px);
-webkit-transform: translate(0px, 0px);
-o-transform: translate(0px, 0px);
-ms-transform: translate(0px, 0px);
transform: translate(0px, 0px);
}
nav li:first-child {
margin-left:48px !important; /* this value should equal the width of .navbefore */
}
nav li a:link, nav li a:visited {
color: #fff;
display: block;
line-height: 3.5em;
padding: 0 1.2125em;
text-decoration: none;
font-weight:bolder;
background: #BF0300;
}
/* transforms the li element on hover, could be animated instead */
nav li:hover {
-moz-transform: translate(18px, -8px);
-webkit-transform: translate(18px, -8px);
-o-transform: translate(18px, -8px);
-ms-transform: translate(18px, -8px);
transform: translate(18px, -8px);
padding-top:18px !important; /* Fixes hover glitch when user moves mouse just above the pressed down li element */
}
/* changes the background color of the link inside the list element */
nav li:hover a:link {
color: #fff;
background: rgb(155,0,0); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzliMDAwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iI2JmMDMwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNhMzAwMDAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(left, rgba(155,0,0,1) 0%, rgba(191,3,0,1) 50%, rgba(163,0,0,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(155,0,0,1)), color-stop(50%,rgba(191,3,0,1)), color-stop(100%,rgba(163,0,0,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(155,0,0,1) 0%,rgba(191,3,0,1) 50%,rgba(163,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(155,0,0,1) 0%,rgba(191,3,0,1) 50%,rgba(163,0,0,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(155,0,0,1) 0%,rgba(191,3,0,1) 50%,rgba(163,0,0,1) 100%); /* IE10+ */
background: linear-gradient(left, rgba(155,0,0,1) 0%,rgba(191,3,0,1) 50%,rgba(163,0,0,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9b0000', endColorstr='#a30000',GradientType=1 ); /* IE6-8 */
}
/* gives the list element a skewed depth pseudo element to the left (before) , fold to the right (after) */
nav ul li:before, nav ul li:after
{
content: '';
position: absolute;
border-color: transparent;
bottom: 0px;
}
nav ul li:before {
display:block;
width:0px;
height:0px;
-moz-transform: translate(0px,0px) skew(0deg,0deg);
-webkit-transform: translate(0px,0px) skew(0deg,0deg);
-o-transform: translate(0px,0px) skew(0deg,0deg);
-ms-transform: translate(0px,0px) skew(0deg,0deg);
transform: translate(0px,0px) skew(0deg,0deg);
}
nav ul li:hover:before {
display:block;
width:18px;
height:56px;
background: rgb(191,3,0); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2JmMDMwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjQwJSIgc3RvcC1jb2xvcj0iI2EzMDAwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM4NDA0MDAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(left, rgba(191,3,0,1) 1%, rgba(163,0,0,1) 40%, rgba(132,4,0,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(1%,rgba(191,3,0,1)), color-stop(40%,rgba(163,0,0,1)), color-stop(100%,rgba(132,4,0,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(191,3,0,1) 1%,rgba(163,0,0,1) 40%,rgba(132,4,0,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(191,3,0,1) 1%,rgba(163,0,0,1) 40%,rgba(132,4,0,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(191,3,0,1) 1%,rgba(163,0,0,1) 40%,rgba(132,4,0,1) 100%); /* IE10+ */
background: linear-gradient(left, rgba(191,3,0,1) 1%,rgba(163,0,0,1) 40%,rgba(132,4,0,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bf0300', endColorstr='#840400',GradientType=1 ); /* IE6-8 */
-webkit-transform: translate(-18px,-5px) skew(0deg,28deg);
-o-transform: translate(-18px,-5px) skew(0deg,28deg);
-ms-transform: translate(-18px,-5px) skew(0deg,28deg);
transform: translate(-18px,-5px) skew(0deg,28deg);
/* doesnt work -moz-transform: translate(-18px,-5px) skew(0deg,28deg); */
}
@-moz-document url-prefix() {
nav ul li:hover:before {
margin-left:-18px;
margin-bottom:3px;
-moz-transform: translateY(-2px);
-moz-transform: skewX(0deg);
-moz-transform: skewY(28deg);
}
}
nav ul li:hover:after {
border-width: 0 0 10px 10px;
border-left-color: #5E0100;
right: -10px;
border-style: solid;
}
/* moves the next list element over 18px, why 18px? well thats the width of nav ul li:hover:before (16px + 2px border) */
nav li:hover + li {
-moz-transform: translate(18px, 0px);
-webkit-transform: translate(18px, 0px);
-o-transform: translate(18px, 0px);
-ms-transform: translate(18px, 0px);
transform: translate(18px, 0px);
}
nav li.noHover a:link, nav li.noHover a:visited {
color:rgb(191,3,0);
background: #BF0300;
width:68px;
}
nav li.noHover:hover {
background:rgb(191,3,0);
-moz-transform: translate(0px, 0px);
-webkit-transform: translate(0px, 0px);
-o-transform: translate(0px, 0px);
-ms-transform: translate(0px, 0px);
transform: translate(0px, 0px);
padding-top:0px !important; /* Fixes hover glitch when user moves mouse just above the pressed down li element */
}
nav li.noHover:hover a:link {
color:rgb(191,3,0);
}
nav ul li.noHover:hover:before {
display:none;
}
nav ul li.noHover:hover:after {
border:0 none;
}
/*nav li:hover + span {
width:262px;
-moz-transform: translate(0px, 0px);
-webkit-transform: translate(0px, 0px);
-o-transform: translate(0px, 0px);
-ms-transform: translate(0px, 0px);
transform: translate(0px, 0px);
}*/
#credits {
clear:both;
font-size: 0.5em;
width: 100%;
text-align: center;
padding-top: 36px;
}
/* experimental css fix for last nav element */
/*
THIS JS IS NOW DEPRECATED, Hiding the last <li> fixes the overflow issue. The .navafter span must be correctly sized.
Changes the width of .navafter (the ribbon after the nav buttons) when the last-child li is pressed.
If this wasn't corrected, the nav menu would overflow. Change the width and eq() accordingly when you add and subtract buttons. This also can be down programmatically, but loads slow.
Currently bugs out if you hover over the :before skewed depth of the last-child li element. Not a big deal, but kinda annoying.
var deviceAgent = navigator.userAgent.toLowerCase();
var initWidth, hoverWidth, fixRight;
if ($.browser.mozilla && $.browser.version >= "1.8") {
initWidth = 277;
hoverWidth = 259;
fixRight = 1;
}
else if (deviceAgent.match(/(iphone|ipod|ipad)/)){
initWidth = 277;
hoverWidth = 259;
fixRight = 1;
}
else if ($.browser.webkit) {
initWidth = 280;
hoverWidth = 262;
fixRight = 0;
}
else {
initWidth = 277;
hoverWidth = 259;
fixRight = 0;
}
$('nav ul span.navafter').css('width', initWidth + 'px');
$('nav ul span.navafter').css('right', fixRight + 'px');
$("nav ul li").eq(5).children('a:link').hover(function () {
$('nav ul span.navafter').css('width', hoverWidth + 'px');
}, function () {
$('nav ul span.navafter').css('width', initWidth + 'px');
});*/
Also see: Tab Triggers