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="wrapper">
<nav class="main__menu">
<ul>
<li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li>
</ul>
</nav>
<nav class="main__menu2">
<ul>
<li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li>
</ul>
</nav>
<nav class="main__menu3">
<ul>
<li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li>
</ul>
</nav>
<nav class="main__menu4">
<ul>
<li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li>
</ul>
</nav>
<nav class="main__menu5">
<ul>
<li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li>
</ul>
</nav>
<nav class="main__menu6">
<ul>
<li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li>
</ul>
</nav>
<nav class="main__menu7">
<ul>
<li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li><li><a href="#">Текст</a></li>
</ul>
</nav>
<nav class="main__menu8">
<ul>
<li><a href="#"><i class="fa fa-user-circle-o" aria-hidden="true"></i><span>Text</span></a></li><li><a href="#"><i class="fa fa-bar-chart" aria-hidden="true"></i><span>Text</span></a></li><li><a href="#"><i class="fa fa-book" aria-hidden="true"></i><span>Text</span></a></li><li><a href="#"><i class="fa fa-bookmark" aria-hidden="true"></i><span>Text</span></a></li><li><a href="#"><i class="fa fa-cogs" aria-hidden="true"></i><span>Text</span></a></li>
</ul>
</nav>
<nav class="main__menu9">
<ul>
<li><a href="#"><span>Text</span><i class="fa fa-cogs" aria-hidden="true"></i></a></li><li><a href="#"><span>Text</span><i class="fa fa-bookmark" aria-hidden="true"></i></a></li><li><a href="#"><span>Text</span><i class="fa fa-book" aria-hidden="true"></i></a></li><li><a href="#"><span>Text</span><i class="fa fa-bar-chart" aria-hidden="true"></i></a></li><li><a href="#"><span>Text</span><i class="fa fa-user-circle-o" aria-hidden="true"></i></a></li>
</ul>
</nav>
<nav class="main__menu10">
<ul>
<li><a href="#"><span>Text</span><i class="fa fa-cogs" aria-hidden="true"></i></a></li><li><a href="#"><span>Text</span><i class="fa fa-bookmark" aria-hidden="true"></i></a></li><li><a href="#"><span>Text</span><i class="fa fa-book" aria-hidden="true"></i></a></li><li><a href="#"><span>Text</span><i class="fa fa-bar-chart" aria-hidden="true"></i></a></li><li><a href="#"><span>Text</span><i class="fa fa-user-circle-o" aria-hidden="true"></i></a></li>
</ul>
</nav>
<div style="padding: 40px 0;"></div>
</div>
@import "bourbon"
@import url('https://fonts.googleapis.com/css?family=Roboto')
$a: #000
$m1: #701dbb
$m2: #C11111
$m3: #00B4FF
$m4: #FF4E00
$m5: #159F6D
$m6: #ff3333
$m6_2: #FFD133
$m6_3: #63FF33
$m6_4: #33C3FF
$m6_5: #C833FF
$m8: #157D9F
$m9: #5C9F15
$m10: #9F1573
html, body
width: 100%
height: 100%
font-family: 'Roboto', sans-serif
letter-spacing: 2px
.wrapper
width: 100%
background: linear-gradient(135deg, #e1e1e1 0%, white 50%, #e1e1e1 100%)
a
text-transform: uppercase
transition: all .2s ease
text-decoration: none
color: #000
&:hover
text-decoration: none
transition: all .2s ease-in
/* menu */
.main__menu
ul
display: flex
justify-content: center
overflow: hidden
li
display: inline-block
border-right: 1px solid #F6F6F6
border-top: 1px solid #FAFAFA
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16)
&:last-child
border-right: 0
a
&:before
right: 0
&:hover
border-right-color: transparent
border-top-color: transparent
a
+pr
display: block
padding: 40px
background: linear-gradient(to bottom, #ffffff 0%, #f6f6f6 47%, #fafafa 100%)
transition: all .1s ease
&:before
+c
+pa
left: 0
right: -1px
height: 3px
background: $m1
bottom: 0
transition: all .2s ease
&:hover
transform: translate(0, -5px) scale(1.1)
transition: all .1s ease-in
box-shadow: 1px 1px 10px rgba($m1, 0.16)
z-index: 88
&:before
right: 0
/* menu2 */
.main__menu2
margin-top: 50px
ul
display: flex
justify-content: center
overflow: hidden
li
display: inline-block
border-right: 1px solid #F6F6F6
border-top: 1px solid #FAFAFA
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16)
&:last-child
border-right: 0
a
&:before
right: 0
a
+pr
display: block
padding: 40px
background: linear-gradient(to bottom, #ffffff 0%, #f6f6f6 47%, #fafafa 100%)
transition: all .1s ease
&:before
+c
+pa
left: 0
right: -1px
height: 3px
background: $m2
bottom: 0
transition: all .2s ease
&:hover
transform: translate(0, -5px)
transition: all .2s ease-in
color: $m2
&:before
height: 8px
bottom: -5px
transition: all .2s ease-in
/* menu3 */
.main__menu3
margin-top: 50px
ul
display: flex
justify-content: center
overflow: hidden
li
display: inline-block
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16)
+pr
display: block
height: 100px
min-width: 120px
background: linear-gradient(to bottom, #ffffff 0%, #f6f6f6 47%, #fafafa 100%)
transition: all .1s ease
&:after
+c
+pa
left: 0
right: -1px
height: 3px
background: $m3
bottom: 0
transition: all .2s ease
&:hover
transform: translate(0, -5px)
// transition: all .2s ease-in
transition: all .2s cubic-bezier(0, 1.35, 0.85, 1.81)
&:after
height: 8px
bottom: -5px
// transition: all .2s ease-in
transition: all .2s cubic-bezier(0, 1.35, 0.85, 1.81)
&:last-child
a
&:before
right: 0
&:nth-child(1)
a
&:before
content: '\f1b2'
&:nth-child(2)
a
&:before
content: '\f140'
&:nth-child(3)
a
&:before
content: '\f0e5'
&:nth-child(4)
a
&:before
content: '\f0e0'
&:nth-child(5)
a
&:before
content: '\f013'
a
width: 100%
height: 100%
display: block
line-height: 150px
+pr
font-size: 12px
text-align: center
&:hover
color: $m3
&:before
display: block
line-height: 0
+pr
top: 35px
text-align: center
font-size: 40px
font-family: FontAwesome
/* menu4 */
.main__menu4
margin-top: 50px
ul
display: flex
justify-content: center
overflow: hidden
li
display: inline-block
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16)
+pr
display: block
height: 100px
min-width: 120px
background: linear-gradient(to bottom, #ffffff 0%, #f6f6f6 47%, #fafafa 100%)
transition: all .1s ease
&:after
+c
+pa
left: 0
right: -1px
height: 3px
background: $m4
bottom: 0
transition: all .2s ease
&:before
+c
+arr(20, 5, $m4, t)
+pa
left: 50%
margin-left: -10px
opacity: 0
bottom: 0
transition: all .2s ease
&:hover
transform: translate(0, -5px)
transition: all .2s cubic-bezier(0, 1.35, 0.85, 1.81)
&:after
height: 8px
bottom: -5px
transition: all .2s cubic-bezier(0, 1.35, 0.85, 1.81)
&:before
opacity: 1
bottom: 2.9px
transition: all .2s ease
&:last-child
a
&:before
right: 0
&:nth-child(1)
a
&:before
content: '\f1b2'
&:nth-child(2)
a
&:before
content: '\f140'
&:nth-child(3)
a
&:before
content: '\f0e5'
&:nth-child(4)
a
&:before
content: '\f0e0'
&:nth-child(5)
a
&:before
content: '\f013'
a
width: 100%
height: 100%
display: block
line-height: 150px
+pr
font-size: 12px
text-align: center
&:hover
color: $m4
&:before
display: block
line-height: 0
+pr
top: 35px
text-align: center
font-size: 40px
font-family: FontAwesome
/* menu5 */
.main__menu5
margin-top: 50px
ul
display: flex
justify-content: center
overflow: hidden
li
display: inline-block
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16)
+pr
display: block
height: 100px
min-width: 120px
background: linear-gradient(to bottom, #ffffff 0%, #f6f6f6 47%, #fafafa 100%)
transition: all .1s ease
&:after
+c
+pa
left: 0
right: -1px
height: 3px
background: #000
bottom: 0
transition: all .2s ease
&:before
+c
+arr(20, 5, $m5, t)
+pa
left: 50%
margin-left: -10px
opacity: 0
bottom: 0
transition: all .2s ease
&:hover
transform: translate(0, -5px)
transition: all .2s cubic-bezier(0, 1.35, 0.85, 1.81)
&:after
height: 8px
bottom: -5px
transition: all .2s cubic-bezier(0, 1.35, 0.85, 1.81)
background: $m5
&:before
opacity: 1
bottom: 2.9px
transition: all .2s ease
&:last-child
a
&:before
right: 0
&:nth-child(1)
a
&:before
content: '\f1b2'
&:nth-child(2)
a
&:before
content: '\f140'
&:nth-child(3)
a
&:before
content: '\f0e5'
&:nth-child(4)
a
&:before
content: '\f0e0'
&:nth-child(5)
a
&:before
content: '\f013'
a
width: 100%
height: 100%
display: block
line-height: 150px
+pr
font-size: 12px
text-align: center
&:hover
color: $m5
&:before
display: block
line-height: 0
+pr
top: 35px
text-align: center
font-size: 40px
font-family: FontAwesome
/* menu 6 */
.main__menu6
margin-top: 50px
ul
display: flex
justify-content: center
li
display: inline-block
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16)
overflow-x: hidden
a
text-transform: none
display: block
padding: 20px
background: linear-gradient(to bottom, #ffffff 0%, #f6f6f6 47%, #fafafa 100%)
overflow: hidden
+pr
z-index: 99
&:after
+c
+pa
left: 0
right: 0
top: -3px
background: shade($m6, 20%)
height: 3px
opacity: 0
&:before
+c
width: 200%
height: 100%
background: $m6
+pa
left: -250%
top: 0
transform: skew(20deg)
transition: all .2s ease
z-index: -1
&:hover
color: #fff
transition: all .2s ease
&:before
left: -50%
transition: all .2s ease
&:after
top: 0
opacity: 1
/* menu 7 */
.main__menu7
margin-top: 50px
ul
display: flex
justify-content: center
li
display: inline-block
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16)
+pr
overflow-x: hidden
&:nth-child(1)
a
&:before
background: $m6
&:after
background: shade($m6, 20%)
&:nth-child(2)
a
&:before
background: $m6_2
&:after
background: shade($m6_2, 20%)
&:nth-child(3)
a
&:before
background: $m6_3
&:after
background: shade($m6_3, 20%)
&:nth-child(4)
a
&:before
background: $m6_4
&:after
background: shade($m6_4, 20%)
&:nth-child(5)
a
&:before
background: $m6_5
&:after
background: shade($m6_5, 20%)
a
text-transform: none
display: block
padding: 10px 20px
background: linear-gradient(to bottom, #ffffff 0%, #f6f6f6 47%, #fafafa 100%)
overflow: hidden
+pr
z-index: 99
&:after
+c
+pa
left: 0
right: 0
top: -3px
height: 3px
opacity: 0
&:before
+c
width: 200%
height: 100%
+pa
left: -250%
top: 0
transform: skew(20deg)
transition: all .2s ease
z-index: -1
&:hover
color: #fff
text-shadow: 0px 0px 1px rgba(0, 0, 0, 1)
transition: all .2s ease
&:before
left: -50%
transition: all .2s ease
&:after
top: 0
opacity: 1
/* menu 8 */
.main__menu8
margin-top: 50px
ul
display: flex
justify-content: center
li
display: inline-block
a
display: block
font-size: 40px
text-align: center
padding: 10px 30px
transition: all .3s ease-in
i
transition: transform .3s ease
span
+pr
top: 10px
font-size: 11px
opacity: 0
display: block
transition: all .3s ease-in
// border: 2px solid transparent
padding: 5px 10px
// border-radius: 5px
&:before
opacity: 0
transition: all .3s ease-in
&:hover
transition: all .3s ease-in
color: $m8
i
transform: scale(1.2)
transition: transform .3s ease
span
opacity: 1
transition: all .3s ease-in
// border-color: $m8
color: $m8
&:before
+c
+pa
opacity: 1
top: -6px
left: 50%
margin-left: -5px
+arr(10, 5, $m8, t)
transition: all .3s ease-in
/* menu 9 */
.main__menu9
margin-top: 50px
ul
display: flex
justify-content: center
li
display: inline-block
font-size: 40px
a
display: block
padding: 15px 40px
text-align: center
transition: all .1s ease-out
overflow: hidden
+pr
&:before
+c
+pa
bottom: -10px
right: 2px
+arr(10, 10, $m9, tl)
opacity: 0
transition: all .2s ease-out
transform: rotate(45deg)
span
padding: 5px 0
transition: all .2s ease-out
display: block
font-size: 11px
opacity: 0
font-weight: bold
&:hover
transition: all .1s ease-out
color: $m9
text-shadow: 4px 4px 5px rgba($m9, 0.4)
span
transition: all .2s ease-out
opacity: 1
text-shadow: none
&:before
bottom: 0
opacity: 1
transition: all .2s ease-out
transform: rotate(0deg)
/* menu 10 */
.main__menu10
margin-top: 50px
ul
display: flex
justify-content: center
li
display: inline-block
font-size: 40px
a
display: block
padding: 20px 40px
text-align: center
transition: all .1s ease-out
overflow: hidden
filter: blur(1px)
+pr
&:before
+c
+pa
bottom: -10px
left: 50%
margin-left: -5px
+arr(10, 10, $m10, tl)
opacity: 0
transition: all .2s ease-out
transform: rotate(45deg)
span
padding: 5px 0
transition: all .2s ease-out
display: block
font-size: 11px
opacity: 0
font-weight: bold
&:hover
transition: all .1s ease-out
color: $m10
text-shadow: 4px 4px 5px rgba($m10, 0.4)
filter: blur(0px) !important
span
transition: all .2s ease-out
opacity: 1
text-shadow: none
&:before
bottom: -5px
opacity: 1
transition: all .2s ease-out
transform: rotate(45deg)
Also see: Tab Triggers