How can i circle numbers around the circular menu - html

I did 8 menus with the radical circle menu. But I have 8 numbers that need to surround a circle menu. I am having a bit of a problem, thought it would be a good idea to have a circle menu with numbers surrounding it, the problem that I have is that only the number circle is not placed properly, maybe I mess up something in the code, could you help me?
I am just confused about this number circle.
.component {
position: relative;
margin-bottom: 3em;
height: 15em;
}
.cn-button {
position: absolute;
top: 115%;
left: 56%;
z-index: 11;
margin-top: -4.5em;
margin-left: -5em;
padding: 0;
width: 8em;
height: 8em;
border: none;
border-radius: 50%;
background: none;
background-color: #004691;
color: #5f259f;
text-align: center;
font-weight: 700;
font-size: 1em;
text-transform: uppercase;
cursor: pointer;
-webkit-backface-visibility: hidden;
border: 6px solid #fff;
}
.circle-wrapper {
// width: 680px;
height: 501px;
border-radius: 51%;
// background: Chartreuse;
position: relative;
// margin: 100px;
transform: rotate(23deg);
}
.circle {
display: block;
position: absolute;
top: 54%;
left: 54%;
width: 50px;
height: 50px;
margin: -48px -48px -48px -53px;
background: red;
border-radius: 51%;
text-align: center;
line-height: 50px;
}
.deg-0 {
transform: rotate(45deg) translate(251px) rotate(-65deg);
background: #5ede29;
color: white;
font-weight: 600;
}
.deg-45 {
transform: rotate(90deg) translate(251px) rotate(-110deg);
background: #ffe816;
color: white;
font-weight: 600;
}
.deg-90 {
transform: rotate(135deg) translate(251px) rotate(-158deg);
background: #f74015;
color: white;
font-weight: 600;
}
.deg-135 {
transform: rotate(180deg) translate(251px) rotate(-200deg);
background: #54bef8;
color: white;
font-weight: 600;
}
.deg-180 {
transform: rotate(225deg) translate(251px) rotate(-248deg);
background: #5ede29;
color: white;
font-weight: 600;
}
.deg-225 {
transform: rotate(270deg) translate(251px) rotate(-289deg);
background: #ffe816;
color: white;
font-weight: 600;
}
.deg-270 {
transform: rotate(315deg) translate(251px) rotate(-338deg);
background: #f74015;
color: white;
font-weight: 600;
}
.deg-315 {
background: #54bef8;
transform: rotate(360deg) translate(251px) rotate(-380deg);
color: white;
font-weight: 600;
}
.btnDeactivated {
background-color: #f7f4f4 !important;
color: rgb(184 124 38);
border: 2px solid #a57c2633 !important;
}
.csstransforms .cn-wrapper {
position: absolute;
top: 100%;
left: 50%;
z-index: 10;
margin-top: -16em;
margin-left: -15.5em;
width: 34em;
height: 34em;
border-radius: 50%;
font-weight: bold;
background: transparent;
/* opacity: 0; */
-webkit-transition: all 0.3s ease 0.3s;
-moz-transition: all 0.3s ease 0.3s;
transition: all 0.3s ease 0.3s;
-webkit-transform: scale(0.1);
-ms-transform: scale(0.1);
-moz-transform: scale(0.1);
transform: scale(0.1);
pointer-events: none;
overflow: hidden;
}
/*cover to prevent extra space of anchors from being clickable*/
.csstransforms .cn-wrapper:after {
content: ".";
display: block;
font-size: 2em;
width: 6.2em;
height: 6.2em;
position: absolute;
left: 50%;
margin-left: -3.1em;
top: 50%;
margin-top: -3.1em;
border-radius: 50%;
z-index: 10;
color: transparent;
}
.csstransforms .opened-nav {
border-radius: 50%;
/* opacity: 0.2; */
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
transition: all 0.3s ease;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
pointer-events: auto;
}
.cn-wrapper ul {
position: relative;
list-style: none;
margin: 0;
}
.csstransforms .cn-wrapper li {
position: absolute;
top: 50%;
left: 50%;
overflow: hidden;
// margin-top: -1.3em;
margin-left: -12em;
width: 12em;
height: 12em;
font-size: 1.5em;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
transition: all 0.3s ease;
-webkit-transform: rotate(60deg) skew(60deg);
-moz-transform: rotate(60deg) skew(60deg);
-ms-transform: rotate(60deg) skew(60deg);
transform: rotate(60deg) skew(60deg);
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
transform-origin: 100% 100%;
pointer-events: none;
border: 4px solid #fff;
}
.csstransforms .cn-wrapper li a {
position: absolute;
right: -7.25em;
bottom: -7.25em;
display: block;
width: 14.5em;
height: 14.5em;
border-radius: 50%;
-moz-box-sizing: border-box;
box-sizing: border-box;
color: #271b1b;
text-align: center;
text-decoration: none;
font-size: 1.2em;
line-height: 2;
-webkit-transform: skew(-44deg) rotate(-68deg);
-moz-transform: skew(-44deg) rotate(-68deg);
-ms-transform: skew(-44deg) rotate(-68deg);
transform: skew(-44deg) rotate(-68deg);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
pointer-events: auto;
letter-spacing: 1px;
}
.csstransforms .cn-wrapper li a span {
position: relative;
top: 3.8em;
display: block;
font-size: 0.7em;
font-weight: bolder;
text-transform: uppercase;
left: -22px;
}
.csstransforms .cn-wrapper li a:hover {
color: white;
}
.csstransforms .cn-wrapper li a {
top: 32px;
transition: top 1s ease 0s;
}
.csstransforms .cn-wrapper li a:active,
.csstransforms .cn-wrapper li a:focus {
color: rgb(255, 255, 255);
font-size: 30px;
font-weight: 600;
text-shadow: 2px 2px 10px black;
top: 19px;
}
.csstransforms .cn-wrapper li a:focus {
position: fixed; /* fix the displacement bug in webkit browsers when using tab key */
}
.csstransforms .opened-nav li {
-webkit-transition: all 0.3s ease 0.3s;
-moz-transition: all 0.3s ease 0.3s;
transition: all 0.3s ease 0.3s;
}
.csstransforms .opened-nav li:first-child {
transform: rotate(45deg) skew(45deg);
background: #5ede29;
}
.csstransforms .opened-nav li:nth-child(2) {
transform: rotate(90deg) skew(45deg);
background: #ffe816;
}
.csstransforms .opened-nav li:nth-child(3) {
transform: rotate(135deg) skew(45deg);
background: #f74015;
}
.csstransforms .opened-nav li:nth-child(4) {
transform: rotate(180deg) skew(45deg);
background: #54bef8;
}
.csstransforms .opened-nav li:nth-child(5) {
transform: rotate(225deg) skew(45deg);
background: #5ede29;
}
.csstransforms .opened-nav li:nth-child(6) {
transform: rotate(270deg) skew(45deg);
background: #ffe816;
}
.csstransforms .opened-nav li:nth-child(7) {
transform: rotate(315deg) skew(45deg);
background: #f74015;
}
.csstransforms .opened-nav li:nth-child(8) {
background: #54bef8;
transform: rotate(360deg) skew(45deg);
}
.no-csstransforms .cn-wrapper {
overflow: hidden;
margin: 10em auto;
padding: 0.5em;
text-align: center;
}
.no-csstransforms .cn-wrapper ul {
display: inline-block;
}
.no-csstransforms .cn-wrapper li {
float: left;
width: 5em;
height: 5em;
background-color: #fff;
text-align: center;
font-size: 1em;
line-height: 5em;
}
.no-csstransforms .cn-wrapper li a {
display: block;
width: 100%;
height: 100%;
color: inherit;
text-decoration: none;
}
.no-csstransforms .cn-wrapper li a:hover,
.no-csstransforms .cn-wrapper li a:active,
.no-csstransforms .cn-wrapper li a:focus {
background-color: #f8f8f8;
}
.no-csstransforms .cn-wrapper li.active a {
background-color: #6f325c;
color: #fff;
}
.no-csstransforms .cn-button {
display: none;
}
.learn {
transform: rotate(23deg);
}
.learn1 {
transform: rotate(-20deg);
}
.learn2 {
transform: rotate(-67deg);
}
.learn3 {
transform: rotate(-112deg);
}
.learn4 {
transform: rotate(-157deg);
}
.learn5 {
transform: rotate(-201deg);
}
.learn6 {
transform: rotate(-247deg);
}
.learn7 {
transform: rotate(69deg);
}
<div class="component csstransforms">
<button class="cn-button" id="cn-button">
<img
style="height: auto; width: 117px"
src="../../assets/Integro-Bank-Logo-Black-background_prev_ui.c022b598.png"
alt="logo"
/>
</button>
<div class="cn-wrapper opened-nav" id="cn-wrapper">
<ul>
<li>
<a #click="showMore" href="javascript:void(0)"
><span class="learn">Learn</span></a
>
</li>
<li>
<a #click="showMore2" href="javascript:void(0)"
><span class="learn1">Review</span></a
>
</li>
<li>
<a #click="showMore3" href="javascript:void(0)"
><span class="learn2">Evaluate</span></a
>
</li>
<li>
<a #click="showMore4" href="javascript:void(0)"
><span class="learn3">Sign-up</span></a
>
</li>
<li>
<a #click="showMore5" href="javascript:void(0)"
><span class="learn4">Engage</span></a
>
</li>
<li>
<a #click="showMore6" href="javascript:void(0)"
><span class="learn5">Share</span></a
>
</li>
<li>
<a #click="showMore7" href="javascript:void(0)"
><span class="learn6">Impact</span></a
>
</li>
<li>
<a #click="showMore8" href="javascript:void(0)"
><span class="learn7">Transform</span></a
>
</li>
</ul>
</div>
<!-- End of Nav Structure -->
</div>
<div class="circle-wrapper">
<div class="circle deg-180 btnDeactivated" id="btn1">1</div>
<div class="circle deg-225 btnDeactivated" id="btn2">2</div>
<div class="circle deg-270 btnDeactivated" id="btn3">3</div>
<div class="circle deg-315 btnDeactivated" id="btn4">4</div>
<div class="circle deg-0 btnDeactivated" id="btn5">5</div>
<div class="circle deg-45 btnDeactivated" id="btn6">6</div>
<div class="circle deg-90 btnDeactivated" id="btn7">7</div>
<div class="circle deg-135 btnDeactivated" id="btn8">8</div>
</div>

It's quite messy, but this is the closest I could get. Comments are added in the snippet below. To sum up, I added some wrappers (see HTML) and changed CSS a little bit.
Please let me know if this is good enough.
.component {
position: relative;
margin-bottom: 3em;
height: 15em;
display: flex; /* Added */
justify-content: center; /* Added */
}
/* Added */
.cn-button-wrapper {
width: 100%;
height: calc(34rem + 250px);
display: flex;
justify-content: center;
align-items: center;
margin-left: 15px;
}
.cn-button {
position: absolute;
/* top: 115%; */ /* Removed */
/* left: 56%; */ /* Removed */
z-index: 11;
/* margin-top: -4.5em; */ /* Removed */
/* margin-left: -5em; */ /* Removed */
padding: 0;
width: 8em;
height: 8em;
border: none;
border-radius: 50%;
background: none;
background-color: #004691;
color: #5f259f;
text-align: center;
font-weight: 700;
font-size: 1em;
text-transform: uppercase;
cursor: pointer;
-webkit-backface-visibility: hidden;
border: 6px solid #fff;
}
/* Added */
.circle-wrapper-outer {
width: 100%;
position: absolute;
top: 0;
top: 100px;
}
.circle-wrapper {
width: 34rem; /* Added */
height: 34rem; /* Added */
border-radius: 50%;
position: relative;
transform: rotate(23deg);
margin-left: auto; /* Added */
margin-right: auto; /* Added */
top: 0; /* Added */
}
.circle {
display: block;
position: absolute;
top: 54%;
left: 54%;
width: 50px;
height: 50px;
margin: -48px -48px -48px -53px;
background: red;
border-radius: 51%;
text-align: center;
line-height: 50px;
}
.deg-0 {
transform: rotate(45deg) translate(251px) rotate(-65deg);
background: #5ede29;
color: white;
font-weight: 600;
}
/* Added */
.deg-0-new {
transform: rotate(45deg) translate(325px) rotate(-65deg);
background: #5ede29;
color: white;
font-weight: 600;
}
.deg-45 {
transform: rotate(90deg) translate(251px) rotate(-110deg);
background: #ffe816;
color: white;
font-weight: 600;
}
/* Added */
.deg-45-new {
transform: rotate(90deg) translate(325px) rotate(-110deg);
background: #ffe816;
color: white;
font-weight: 600;
}
.deg-90 {
transform: rotate(135deg) translate(251px) rotate(-158deg);
background: #f74015;
color: white;
font-weight: 600;
}
/* Added */
.deg-90-new {
transform: rotate(135deg) translate(325px) rotate(-158deg);
background: #f74015;
color: white;
font-weight: 600;
}
.deg-135 {
transform: rotate(180deg) translate(251px) rotate(-200deg);
background: #54bef8;
color: white;
font-weight: 600;
}
/* Added */
.deg-135-new {
transform: rotate(180deg) translate(325px) rotate(-200deg);
background: #54bef8;
color: white;
font-weight: 600;
}
.deg-180 {
transform: rotate(225deg) translate(251px) rotate(-248deg);
background: #5ede29;
color: white;
font-weight: 600;
}
/* Added */
.deg-180-new {
transform: rotate(225deg) translate(305px) rotate(-248deg);
background: #5ede29;
color: white;
font-weight: 600;
}
.deg-225 {
transform: rotate(270deg) translate(251px) rotate(-289deg);
background: #ffe816;
color: white;
font-weight: 600;
}
/* Added */
.deg-225-new {
transform: rotate(270deg) translate(305px) rotate(-289deg);
background: #ffe816;
color: white;
font-weight: 600;
}
.deg-270 {
transform: rotate(315deg) translate(251px) rotate(-338deg);
background: #f74015;
color: white;
font-weight: 600;
}
/* Added */
.deg-270-new {
transform: rotate(315deg) translate(315px) rotate(-338deg);
background: #f74015;
color: white;
font-weight: 600;
}
.deg-315 {
background: #54bef8;
transform: rotate(360deg) translate(251px) rotate(-380deg);
color: white;
font-weight: 600;
}
/* Added */
.deg-315-new {
background: #54bef8;
transform: rotate(360deg) translate(325px) rotate(-380deg);
color: white;
font-weight: 600;
}
.btnDeactivated {
background-color: #f7f4f4 !important;
color: rgb(184 124 38);
border: 2px solid #a57c2633 !important;
}
.csstransforms .cn-wrapper {
position: absolute;
/* top: 100%; */ /* Removed */
/* left: 50%; */ /* Removed */
z-index: 10;
top: 100px; /* Added */
/* margin-top: -16em; */ /* Removed */
/* margin-left: -15.5em; */ /* Removed */
width: 34em;
height: 34em;
border-radius: 50%;
font-weight: bold;
background: transparent;
-webkit-transition: all 0.3s ease 0.3s;
-moz-transition: all 0.3s ease 0.3s;
transition: all 0.3s ease 0.3s;
-webkit-transform: scale(0.1);
-ms-transform: scale(0.1);
-moz-transform: scale(0.1);
transform: scale(0.1);
pointer-events: none;
overflow: hidden;
}
.csstransforms .cn-wrapper:after {
content: ".";
display: block;
font-size: 2em;
width: 6.2em;
height: 6.2em;
position: absolute;
left: 50%;
margin-left: -3.1em;
top: 50%;
margin-top: -3.1em;
border-radius: 50%;
z-index: 10;
color: transparent;
}
.csstransforms .opened-nav {
border-radius: 50%;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
transition: all 0.3s ease;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
pointer-events: auto;
}
.cn-wrapper ul {
position: relative;
list-style: none;
margin: 0;
}
.csstransforms .cn-wrapper li {
position: absolute;
top: 50%;
left: 50%;
overflow: hidden;
margin-left: -12em;
width: 12em;
height: 12em;
font-size: 1.5em;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
transition: all 0.3s ease;
-webkit-transform: rotate(60deg) skew(60deg);
-moz-transform: rotate(60deg) skew(60deg);
-ms-transform: rotate(60deg) skew(60deg);
transform: rotate(60deg) skew(60deg);
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
transform-origin: 100% 100%;
pointer-events: none;
border: 4px solid #fff;
}
.csstransforms .cn-wrapper li a {
position: absolute;
right: -7.25em;
bottom: -7.25em;
display: block;
width: 14.5em;
height: 14.5em;
border-radius: 50%;
-moz-box-sizing: border-box;
box-sizing: border-box;
color: #271b1b;
text-align: center;
text-decoration: none;
font-size: 1.2em;
line-height: 2;
-webkit-transform: skew(-44deg) rotate(-68deg);
-moz-transform: skew(-44deg) rotate(-68deg);
-ms-transform: skew(-44deg) rotate(-68deg);
transform: skew(-44deg) rotate(-68deg);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
pointer-events: auto;
letter-spacing: 1px;
}
.csstransforms .cn-wrapper li a span {
position: relative;
top: 3.8em;
display: block;
font-size: 0.7em;
font-weight: bolder;
text-transform: uppercase;
left: -22px;
}
.csstransforms .cn-wrapper li a:hover {
color: white;
}
.csstransforms .cn-wrapper li a {
top: 32px;
transition: top 1s ease 0s;
}
.csstransforms .cn-wrapper li a:active,
.csstransforms .cn-wrapper li a:focus {
color: rgb(255, 255, 255);
font-size: 30px;
font-weight: 600;
text-shadow: 2px 2px 10px black;
top: 19px;
}
.csstransforms .cn-wrapper li a:focus {
position: fixed;
}
.csstransforms .opened-nav li {
-webkit-transition: all 0.3s ease 0.3s;
-moz-transition: all 0.3s ease 0.3s;
transition: all 0.3s ease 0.3s;
}
.csstransforms .opened-nav li:first-child {
transform: rotate(45deg) skew(45deg);
background: #5ede29;
}
.csstransforms .opened-nav li:nth-child(2) {
transform: rotate(90deg) skew(45deg);
background: #ffe816;
}
.csstransforms .opened-nav li:nth-child(3) {
transform: rotate(135deg) skew(45deg);
background: #f74015;
}
.csstransforms .opened-nav li:nth-child(4) {
transform: rotate(180deg) skew(45deg);
background: #54bef8;
}
.csstransforms .opened-nav li:nth-child(5) {
transform: rotate(225deg) skew(45deg);
background: #5ede29;
}
.csstransforms .opened-nav li:nth-child(6) {
transform: rotate(270deg) skew(45deg);
background: #ffe816;
}
.csstransforms .opened-nav li:nth-child(7) {
transform: rotate(315deg) skew(45deg);
background: #f74015;
}
.csstransforms .opened-nav li:nth-child(8) {
background: #54bef8;
transform: rotate(360deg) skew(45deg);
}
.no-csstransforms .cn-wrapper {
overflow: hidden;
margin: 10em auto;
padding: 0.5em;
text-align: center;
}
.no-csstransforms .cn-wrapper ul {
display: inline-block;
}
.no-csstransforms .cn-wrapper li {
float: left;
width: 5em;
height: 5em;
background-color: #fff;
text-align: center;
font-size: 1em;
line-height: 5em;
}
.no-csstransforms .cn-wrapper li a {
display: block;
width: 100%;
height: 100%;
color: inherit;
text-decoration: none;
}
.no-csstransforms .cn-wrapper li a:hover,
.no-csstransforms .cn-wrapper li a:active,
.no-csstransforms .cn-wrapper li a:focus {
background-color: #f8f8f8;
}
.no-csstransforms .cn-wrapper li.active a {
background-color: #6f325c;
color: #fff;
}
.no-csstransforms .cn-button {
display: none;
}
.learn {
transform: rotate(23deg);
}
.learn1 {
transform: rotate(-20deg);
}
.learn2 {
transform: rotate(-67deg);
}
.learn3 {
transform: rotate(-112deg);
}
.learn4 {
transform: rotate(-157deg);
}
.learn5 {
transform: rotate(-201deg);
}
.learn6 {
transform: rotate(-247deg);
}
.learn7 {
transform: rotate(69deg);
}
<div class="component csstransforms">
<div class="cn-button-wrapper">
<button class="cn-button" id="cn-button">
<img style="height: auto; width: 117px" src="../../assets/Integro-Bank-Logo-Black-background_prev_ui.c022b598.png" alt="logo" />
</button>
</div>
<div class="cn-wrapper opened-nav" id="cn-wrapper">
<ul>
<li>
<a #click="showMore" href="javascript:void(0)"><span class="learn">Learn</span></a>
</li>
<li>
<a #click="showMore2" href="javascript:void(0)"><span class="learn1">Review</span></a>
</li>
<li>
<a #click="showMore3" href="javascript:void(0)"><span class="learn2">Evaluate</span></a>
</li>
<li>
<a #click="showMore4" href="javascript:void(0)"><span class="learn3">Sign-up</span></a>
</li>
<li>
<a #click="showMore5" href="javascript:void(0)"><span class="learn4">Engage</span></a>
</li>
<li>
<a #click="showMore6" href="javascript:void(0)"><span class="learn5">Share</span></a>
</li>
<li>
<a #click="showMore7" href="javascript:void(0)"><span class="learn6">Impact</span></a>
</li>
<li>
<a #click="showMore8" href="javascript:void(0)"><span class="learn7">Transform</span></a>
</li>
</ul>
</div>
<!-- End of Nav Structure -->
</div>
<div class="circle-wrapper-outer">
<div class="circle-wrapper">
<div class="circle deg-180-new btnDeactivated" id="btn1">1</div>
<div class="circle deg-225-new btnDeactivated" id="btn2">2</div>
<div class="circle deg-270-new btnDeactivated" id="btn3">3</div>
<div class="circle deg-315-new btnDeactivated" id="btn4">4</div>
<div class="circle deg-0-new btnDeactivated" id="btn5">5</div>
<div class="circle deg-45-new btnDeactivated" id="btn6">6</div>
<div class="circle deg-90-new btnDeactivated" id="btn7">7</div>
<div class="circle deg-135-new btnDeactivated" id="btn8">8</div>
</div>
</div>

Related

How to create exterior circular rectangle(s)/ partial donut(s) on the circumference of a segment of a circle using CSS

I want to create segment(s) to the exterior of a circular segment, I've looked and implemented a few sites, including, Codrops site, and implemented a partial solution PFA, partial solution, but what i really want is something more like, PFA target solution image, target solution
The desired goal would be to fit as many segments as we can, relative to the interior segment, for example, an interior segment of 120 deg can fit 3 circular rectangular segments of 40 deg each, or 2 of them with 60 deg each respectively.
This is how my current code looks like in REACT, I tried fiddling around with the z-index and rotations of the outer (second) layer, but they just wont stay in the same aligned positions.
import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
const RadialMenuStyles = styled.div`
.cn-wrapper {
font-size:1em;
width: 65em;
height: 65em;
overflow: hidden;
position: fixed;
z-index: 10;
bottom: -13em;
left: 50%;
border-radius: 50%;
margin-left: -13em;
transform: scale(0.1);
transition: all .3s ease;
}
/* class applied to the container via JavaScript that will scale the navigation up */
.opened-nav {
border-radius: 50%;
transform: scale(1);
}
.cn-button {
border:none;
background:none;
color: white;
text-align: Center;
font-size: 1.5em;
padding-bottom: 1em;
height: 3.5em;
width: 3.5em;
background-color: #111;
position: fixed;
left: 50%;
margin-left: -1.75em;
bottom: -1.75em;
border-radius: 50%;
cursor: pointer;
z-index: 11
}
.cn-button:hover,
.cn-button:active,
.cn-button:focus{
background-color: #222;
}
.cn-overlay{
width:100%
height:100%;
background-color: rgba(0,0,0,0.6);
position:fixed;
top:0;
left:0;
bottom:0;
right:0;
opacity:0;
transition: all .3s ease;
z-index:2;
pointer-events:none;
}
/* Class added to the overlay via JavaScript to show it when navigation is open */
.cn-overlay.on-overlay{
pointer-events:auto;
opacity:1;
}
.cn-wrapper li {
position: absolute;
font-size: 1.5em;
width: 10em;
height: 10em;
transform-origin: 100% 100%;
overflow: hidden;
z-index: 10000;
left: 50%;
top: 50%;
margin-top: -1.3em;
margin-left: -10em;
transition: border .3s ease;
}
.cn-wrapper .second-layer li {
position: absolute;
z-index: 100;
font-size: 1.5em;
width: 10em;
height: 10em;
transform-origin: 100% 100%;
left: 40%;
top: 40%;
overflow: hidden;
margin-top: -1.5em;
margin-left: -10em;
transition: border .3s ease;
}
.cn-wrapper li a {
display: block;
font-size: 1.18em;
height: 14.5em;
width: 14.5em;
position: absolute;
bottom: -7.25em;
right: -7.25em;
border-radius: 50%;
text-decoration: none;
color: #fff;
padding-top: 1.8em;
text-align: center;
transform: skew(-50deg) rotate(-70deg) scale(1);
transition: opacity 0.3s, color 0.3s;
}
.cn-wrapper .second-layer li a {
display: block;
font-size: 1.18em;
height: 8.75em;
width: 8.75em;
position: absolute;
bottom: -4.375em;
right: -4.375em;
border-radius: 50%;
text-decoration: none;
color: #fff;
padding-top: 0.8em;
text-align: center;
transform: skew(-30deg) rotate(-60deg) scale(1.5);
transition: opacity 0.3s, color 0.3s;
}
.cn-wrapper li a span {
font-size: 1.1em;
opacity: 0.7;
}
/* for a central angle x, the list items must be skewed by 90-x degrees
in our case x=40deg so skew angle is 50deg
items should be rotated by x, minus (sum of angles - 180)2s (for this demo) */
.cn-wrapper li:first-child {
transform: rotate(-10deg) skew(50deg);
}
.cn-wrapper li:nth-child(2) {
transform: rotate(30deg) skew(50deg);
}
.cn-wrapper li:nth-child(3) {
transform: rotate(70deg) skew(50deg)
}
.cn-wrapper li:nth-child(4) {
transform: rotate(110deg) skew(50deg);
}
.cn-wrapper li:nth-child(5) {
transform: rotate(150deg) skew(50deg);
}
.cn-wrapper li:nth-child(odd) a {
background-color: #a11313;
background-color: hsla(0, 88%, 63%, 1);
}
.cn-wrapper li:nth-child(even) a {
background-color: #a61414;
background-color: hsla(0, 88%, 65%, 1);
}
/* active style */
.cn-wrapper li.active a {
background-color: #b31515;
background-color: hsla(0, 88%, 70%, 1);
}
.cn-wrapper .second-layer li:first-child {
transform: rotate(-10deg) skew(30deg);
}
.cn-wrapper .second-layer li:nth-child(2) {
transform: rotate(50deg) skew(30deg);
}
// .cn-wrapper .second-layer li:nth-child(3) {
// transform: rotate(80deg) skew(50deg)
// }
/* hover style */
.cn-wrapper li:not(.active) a:hover,
.cn-wrapper li:not(.active) a:active,
.cn-wrapper li:not(.active) a:focus {
background-color: #b31515;
background-color: hsla(0, 88%, 70%, 1);
}
.cn-wrapper li:not(.active) a:focus {
position: fixed; /* fix the "displacement" bug in webkit browsers when using tab key */
}
`;
export const RadialMenuComponent: React.FC = () => {
const [openRadialMenu, setOpenRadialMenu] = useState<boolean>(false);
return (
<RadialMenuStyles>
{/* <button className='cn-button' onClick={() => setOpenRadialMenu(true)}>+</button>
{openRadialMenu &&
<ul>
</ul>
} */}
<button className="cn-button" id="cn-button" onClick={() => setOpenRadialMenu(!openRadialMenu)}>+</button>
{openRadialMenu && <div className="opened-nav cn-wrapper" id="cn-wrapper">
<ul>
<li><span className="icon-picture">1</span></li>
<li><span className="icon-headphones">2</span></li>
<li><span className="icon-home">3</span></li>
<li><span className="icon-facetime-video">4</span></li>
<li><span className="icon-envelope-alt">5</span></li>
</ul>
<div className="second-layer">
<ul>
<li><span className="icon-picture">6</span></li>
<li><span className="icon-headphones">7</span></li>
{/* <li><span className="icon-home">8</span></li> */}
{/* <li><span className="icon-facetime-video">4</span></li>
<li><span className="icon-envelope-alt">5</span></li> */}
</ul>
</div>
</div>}
<div id="cn-overlay" className="cn-overlay"></div>
</RadialMenuStyles>
);
};

CSS - Adding menu icon causes problem with website layout

another question regarding my school project. We have to add a menu to our website and i thus googled for a premade menu. Unfortunately, as soon as i add the menu the website layout doesn't really work any more. I already tried making the position absolute but haven't got it to work.
<html lang="de">
<head>
<title>Virtual Reality - Headsetüberblick</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav id="colorlib-main-nav" role="navigation">
<i></i>
<div class="js-fullheight colorlib-table">
<div class="img" style="background-image: url(images/bg_3.jpg);"></div>
<div class="colorlib-table-cell js-fullheight">
<div class="row no-gutters">
<div class="col-md-12 text-center">
<h1 class="mb-4">Gruppe 1</h1>
<ul>
<li class="active"><span>Virtual Relity</span></li>
<li><span>Thema 2</span></li>
<li><span>Thema 3</span></li>
<li><span>Thema 4</span></li>
</ul>
</div>
</div>
</div>
</div>
</nav>
<i></i>
<div class="introduction header h-100 container-fluid d-flex w-100 text-center">
<h1 id="h-100" class="h-100 row col-12 align-items-center text-center display-1 justify-content-center">VIRTUAL REALITY</h1>
</div>
<div class="h-100 container-fluid row">
<h2 style="margin-top: 50px;" class="center col-12 text-center display-4">Was ist Virtual Reality (VR)</h2>
<p class="center col-12 lead">Eine virtuelle Welt oder ein Computerspiel, in das der Nutzer mit Hilfe eines VR-Headsets vollständig eintauchen kann</p>
</div>
...
<div class="footer-basic">
<footer>
<p class="copyright">Lukas Strutz 2021</p>
</footer>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script>
function toggleDiv(whichdiv) {
var x = document.getElementById(whichdiv);
if (x.style.display === "none") {
x.style.display = "flex";
} else {
x.style.display = "none";
}
}
(function($) {
"use strict";
var fullHeight = function() {
$('.js-fullheight').css('height', $(window).height());
$(window).resize(function(){
$('.js-fullheight').css('height', $(window).height());
});
};
fullHeight();
var burgerMenu = function() {
$('.js-colorlib-nav-toggle').on('click', function(event) {
event.preventDefault();
var $this = $(this);
if( $('body').hasClass('menu-show') ) {
$('body').removeClass('menu-show');
$('#colorlib-main-nav > .js-colorlib-nav-toggle').removeClass('show');
} else {
$('body').addClass('menu-show');
setTimeout(function(){
$('#colorlib-main-nav > .js-colorlib-nav-toggle').addClass('show');
}, 900);
}
})
};
burgerMenu();
})(jQuery);
</script>
</body>
</html>
/*
Stylesheet zur VR-Website - Lukas Strutz 2021
Inhalt:
1. Grundsätztliches Design der Website
2. Design des Menüs (bezogen von Colorlib)
3. Design des Footers (bezogen von epicbootstrap.com)
*/
#font-face {
font-family: 'cf_glitch_cityregular';
src: url('fonts/cfglitchcityregular-l1vz-webfont.woff2') format('woff2'),
url('fonts/cfglitchcityregular-l1vz-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
html, body {
background-color: black;
color: white;
height: 100%;
min-height: 100%;
}
#h-100{
/*height: 100%;
min-height: 100%;*/
/*padding-top: 30%;
padding-bottom: 30%;*/
text-align: center;
}
/*h1 {
top: 50%;
transform: translateY(-50%);
}*/
h1{
font-family: "cf_glitch_cityregular";
}
.introduction {
background-image: url("beat-saber-intro.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: cover;
}
.sketchfab-embed-wrapper{
height: 100%;
margin-bottom: 200px;
}
iframe{
height: 100%;
width: 100%;
}
header {
height: 100%;
min-height: 100%;
}
.center{
text-align: center;
}
.steamvr{
background-image: url("https://www.vrnerds.de/wp-content/uploads/2016/02/Steam-VR-Spiele.png");
}
.oculus{
background-image: url("oculus.jpg");
}
/* Menu*/
.img {
background-size: cover;
background-repeat: no-repeat;
background-position: center center; }
#colorlib-main-nav {
position: absolute;
top: 0;
bottom: 0;
right: 0;
padding: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.99);
z-index: 1002;
text-align: center;
visibility: hidden;
opacity: 0;
-webkit-transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
-moz-transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
-ms-transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
-o-transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
-webkit-transform: scale(0.1);
-moz-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0);
overflow-y: scroll; }
#colorlib-main-nav .colorlib-table {
display: table;
width: 100%;
height: 100%; }
#colorlib-main-nav .colorlib-table .img {
position: absolute;
top: 0;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
opacity: 1; }
#colorlib-main-nav .colorlib-table .img:after {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
content: '';
background: rgba(0, 0, 0, 0.3); }
#colorlib-main-nav .colorlib-table .colorlib-table-cell {
display: table-cell;
vertical-align: middle; }
#colorlib-main-nav .colorlib-nav-toggle {
position: absolute;
top: 40px;
right: 40px;
padding: 20px;
height: 44px;
width: 44px;
line-height: 0;
padding: 0 !important;
visibility: hidden;
opacity: 0;
-webkit-transition: 0.3s;
-o-transition: 0.3s;
transition: 0.3s; }
#media (prefers-reduced-motion: reduce) {
#colorlib-main-nav .colorlib-nav-toggle {
-webkit-transition: none;
-o-transition: none;
transition: none; } }
#colorlib-main-nav .colorlib-nav-toggle i {
top: 18px !important;
left: 0 !important;
margin: 0 !important;
padding: 0 !important;
line-height: 0;
text-indent: 0; }
#colorlib-main-nav .colorlib-nav-toggle.show {
visibility: visible;
opacity: 1; }
#colorlib-main-nav .colorlib-nav-toggle:hover i::before, #colorlib-main-nav .colorlib-nav-toggle:hover i::after {
content: '';
width: 40px;
height: 2px;
background: #fff;
position: absolute;
left: 0; }
.menu-show #colorlib-main-nav {
visibility: visible;
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1); }
#colorlib-main-nav .logo {
font-size: 40px;
color: #fff;
text-transform: uppercase;
letter-spacing: 2px;
font-weight: 700;
position: relative;
display: inline-block;
margin-bottom: 0;
line-height: 1.5;
font-family: "Poppins", Arial, sans-serif; }
#colorlib-main-nav .logo span {
font-size: 14px;
display: block;
font-weight: 300;
color: rgba(255, 255, 255, 0.8);
letter-spacing: 8px; }
#colorlib-main-nav ul {
padding: 0;
margin: 0;
display: block; }
#media (max-width: 767.98px) {
#colorlib-main-nav ul {
padding: 20px 0 0 0; } }
#colorlib-main-nav ul li {
padding: 0;
margin: 0;
list-style: none;
font-weight: 600;
font-size: 14px;
letter-spacing: 5px;
text-transform: uppercase; }
#colorlib-main-nav ul li a {
display: block;
color: white;
padding: 5px 0; }
#colorlib-main-nav ul li a span {
color: white;
position: relative;
padding: 0 10px; }
#colorlib-main-nav ul li a span small {
position: absolute;
bottom: 7px;
left: -30px;
font-size: 16px;
color: rgba(255, 255, 255, 0.3);
border-bottom: 1px solid rgba(255, 255, 255, 0.3); }
#colorlib-main-nav ul li a:hover, #colorlib-main-nav ul li a:active, #colorlib-main-nav ul li a:focus {
outline: none;
text-decoration: none; }
#colorlib-main-nav ul li a:hover span:before, #colorlib-main-nav ul li a:active span:before, #colorlib-main-nav ul li a:focus span:before {
visibility: visible;
-webkit-transform: scaleX(1);
-moz-transform: scaleX(1);
-ms-transform: scaleX(1);
-o-transform: scaleX(1);
transform: scaleX(1); }
#colorlib-main-nav ul li.active a span {
color: #f8b500; }
#colorlib-main-nav ul li.active a span:before {
background: #fec771;
visibility: visible;
-webkit-transform: scaleX(1);
-moz-transform: scaleX(1);
-ms-transform: scaleX(1);
-o-transform: scaleX(1);
transform: scaleX(1); }
header {
padding: 2em 0;
position: absolute;
top: 0;
left: 0;
right: 0;
z-index: 9;
margin: 0 auto; }
#media (max-width: 767.98px) {
header {
padding: 1em 0;
position: absolute; } }
header .colorlib-navbar-brand {
float: left; }
header .colorlib-navbar-brand .colorlib-logo {
font-size: 12px;
color: #fff;
letter-spacing: 5px;
font-weight: 600;
position: relative;
display: inline-block;
margin-bottom: 0;
line-height: 1.5;
font-family: "Poppins", Arial, sans-serif;
text-transform: uppercase; }
header .colorlib-navbar-brand .colorlib-logo span {
font-size: 11px;
display: block;
font-weight: 300;
color: rgba(255, 255, 255, 0.8);
letter-spacing: 7px; }
header .colorlib-navbar-brand .colorlib-logo i {
color: #fec771;
position: absolute;
top: -18px;
bottom: 0;
left: 7px;
font-size: 48px; }
header .colorlib-navbar-brand .colorlib-logo:hover {
text-decoration: none !important; }
header .colorlib-navbar-brand .colorlib-logo:active, header .colorlib-navbar-brand .colorlib-logo:focus {
outline: none;
text-decoration: none; }
.colorlib-nav-toggle {
cursor: pointer;
text-decoration: none; }
.colorlib-nav-toggle.active i::before, .colorlib-nav-toggle.active i::after {
background: #000; }
.colorlib-nav-toggle.dark.active i::before, .colorlib-nav-toggle.dark.active i::after {
background: #000; }
.colorlib-nav-toggle:hover, .colorlib-nav-toggle:focus, .colorlib-nav-toggle:active {
outline: none;
border-bottom: none !important; }
.colorlib-nav-toggle i {
position: relative;
display: inline-block;
width: 20px;
height: 2px;
color: white;
font: bold 14px/.4 Helvetica;
text-transform: uppercase;
text-indent: -55px;
background: #fff;
-webkit-transition: all .2s ease-out;
-o-transition: all .2s ease-out;
transition: all .2s ease-out; }
.menu-show .colorlib-nav-toggle i {
background: #fff;
color: #fff; }
.colorlib-nav-toggle i::before, .colorlib-nav-toggle i::after {
content: '';
width: 30px;
height: 2px;
background: #fff;
position: absolute;
left: 0;
-webkit-transition: 0.2s;
-o-transition: 0.2s;
transition: 0.2s; }
.menu-show .colorlib-nav-toggle i::before, .menu-show .colorlib-nav-toggle i::after {
background: #fff; }
#media (prefers-reduced-motion: reduce) {
.colorlib-nav-toggle i::before, .colorlib-nav-toggle i::after {
-webkit-transition: none;
-o-transition: none;
transition: none; } }
.colorlib-nav-toggle.dark i {
position: relative;
color: #fff;
background: #fff;
-webkit-transition: all .2s ease-out;
-o-transition: all .2s ease-out;
transition: all .2s ease-out; }
.colorlib-nav-toggle.dark i::before, .colorlib-nav-toggle.dark i::after {
background: #fff;
-webkit-transition: 0.2s;
-o-transition: 0.2s;
transition: 0.2s; }
#media (prefers-reduced-motion: reduce) {
.colorlib-nav-toggle.dark i::before, .colorlib-nav-toggle.dark i::after {
-webkit-transition: none;
-o-transition: none;
transition: none; } }
.colorlib-nav-toggle i::before {
top: -7px; }
.colorlib-nav-toggle i::after {
bottom: -7px; }
.colorlib-nav-toggle:hover i::before {
top: -10px; }
.colorlib-nav-toggle:hover i::after {
bottom: -10px; }
.colorlib-nav-toggle.active i {
background: transparent; }
.colorlib-nav-toggle.active i::before {
top: 0;
-webkit-transform: rotateZ(45deg);
-moz-transform: rotateZ(45deg);
-ms-transform: rotateZ(45deg);
-o-transform: rotateZ(45deg);
transform: rotateZ(45deg); }
.colorlib-nav-toggle.active i::after {
bottom: 0;
-webkit-transform: rotateZ(-45deg);
-moz-transform: rotateZ(-45deg);
-ms-transform: rotateZ(-45deg);
-o-transform: rotateZ(-45deg);
transform: rotateZ(-45deg); }
.colorlib-nav-toggle {
float: right;
z-index: 1003;
position: relative;
top: 0;
right: 0;
display: block;
margin: 0 auto;
cursor: pointer;
margin-top: 0; }
#media (max-width: 767.98px) {
.colorlib-nav-toggle {
right: 10px; } }
.hero-wrap {
background: #202020; }
.hero-wrap .slider-text .desc h1 {
font-size: 6vw;
font-weight: 700;
color: #fff;
text-transform: uppercase; }
.hero-wrap .slider-text .desc h3 {
color: rgba(255, 255, 255, 0.8);
font-size: 18px; }
.footer-basic {
padding:40px 0;
background-color:#000;
/*color:#6b6c6d;*/
}
.footer-basic .copyright {
margin-top:15px;
text-align:center;
font-size:13px;
color:rgb(255, 255, 255);
margin-bottom:0;
}
/* Credit to https://epicbootstrap.com/snippets/footer-basic */
You can also see this online at: https://lukasstrutz.de/website/thisdoesnotwork.html

Headline isn't centered even though it has the text-center attribute

im crating a website for a school project. Right now I'm trying to get my headlines centered.
Unfortunatly I can't figure out how to center my h1. All the other headlines work just fine except that one.
I tried different methods of centering like the Bootstrap text-center class but none of them seem to work.
Is there any error I made? I would be grateful for help!
PS: Please excuse my bad english, I'm trying to get better at writing english without using a translator
<!doctype html>
<html lang="de">
<head>
<title>Virtual Reality - Headsetüberblick</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav id="colorlib-main-nav" role="navigation">
<i></i>
<div class="js-fullheight colorlib-table">
<div class="img" style="background-image: url(images/bg_3.jpg);"></div>
<div class="colorlib-table-cell js-fullheight">
<div class="row no-gutters">
<div class="col-md-12 text-center">
<h1 class="mb-4">Gruppe 1</h1>
<ul>
<li class="active"><span>Virtual Relity</span></li>
<li><span>Thema 2</span></li>
<li><span>Thema 3</span></li>
<li><span>Thema 4</span></li>
</ul>
</div>
</div>
</div>
</div>
</nav>
<!--<i></i>-->
<div class="introduction header h-100 container-fluid d-flex w-100 text-center">
<h1 id="h-100" class="h-100 row col-12 align-items-center text-center display-1">VIRTUAL REALITY</h1>
</div>
<div class="h-100 container-fluid row">
<h2 style="margin-top: 50px;" class="center col-12 text-center display-4">Was ist Virtual Reality (VR)</h2>
<p class="center col-12 lead">Eine virtuelle Welt oder ein Computerspiel, in das der Nutzer mit Hilfe eines VR-Headsets vollständig eintauchen kann</p>
</div>
<div class="footer-basic">
<footer>
<p class="copyright">Lukas Strutz 2021</p>
</footer>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>
#font-face {
font-family: 'cf_glitch_cityregular';
src: url('fonts/cfglitchcityregular-l1vz-webfont.woff2') format('woff2'),
url('fonts/cfglitchcityregular-l1vz-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
html, body {
background-color: black;
color: white;
height: 100%;
min-height: 100%;
}
#h-100{
/*height: 100%;
min-height: 100%;*/
/*padding-top: 30%;
padding-bottom: 30%;*/
text-align: center;
}
/*h1 {
top: 50%;
transform: translateY(-50%);
}*/
h1{
font-family: "cf_glitch_cityregular";
}
.introduction {
background-image: url("beat-saber-intro.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: cover;
}
.sketchfab-embed-wrapper{
height: 100%;
margin-bottom: 200px;
}
iframe{
height: 100%;
width: 100%;
}
header {
height: 100%;
min-height: 100%;
}
.center{
text-align: center;
}
.steamvr{
background-image: url("https://www.vrnerds.de/wp-content/uploads/2016/02/Steam-VR-Spiele.png");
}
.oculus{
background-image: url("oculus.jpg");
}
/* Menu*/
.img {
background-size: cover;
background-repeat: no-repeat;
background-position: center center; }
#colorlib-main-nav {
position: absolute;
top: 0;
bottom: 0;
right: 0;
padding: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.99);
z-index: 1002;
text-align: center;
visibility: hidden;
opacity: 0;
-webkit-transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
-moz-transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
-ms-transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
-o-transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
-webkit-transform: scale(0.1);
-moz-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0);
overflow-y: scroll; }
#colorlib-main-nav .colorlib-table {
display: table;
width: 100%;
height: 100%; }
#colorlib-main-nav .colorlib-table .img {
position: absolute;
top: 0;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
opacity: 1; }
#colorlib-main-nav .colorlib-table .img:after {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
content: '';
background: rgba(0, 0, 0, 0.3); }
#colorlib-main-nav .colorlib-table .colorlib-table-cell {
display: table-cell;
vertical-align: middle; }
#colorlib-main-nav .colorlib-nav-toggle {
position: absolute;
top: 40px;
right: 40px;
padding: 20px;
height: 44px;
width: 44px;
line-height: 0;
padding: 0 !important;
visibility: hidden;
opacity: 0;
-webkit-transition: 0.3s;
-o-transition: 0.3s;
transition: 0.3s; }
#media (prefers-reduced-motion: reduce) {
#colorlib-main-nav .colorlib-nav-toggle {
-webkit-transition: none;
-o-transition: none;
transition: none; } }
#colorlib-main-nav .colorlib-nav-toggle i {
top: 18px !important;
left: 0 !important;
margin: 0 !important;
padding: 0 !important;
line-height: 0;
text-indent: 0; }
#colorlib-main-nav .colorlib-nav-toggle.show {
visibility: visible;
opacity: 1; }
#colorlib-main-nav .colorlib-nav-toggle:hover i::before, #colorlib-main-nav .colorlib-nav-toggle:hover i::after {
content: '';
width: 40px;
height: 2px;
background: #fff;
position: absolute;
left: 0; }
.menu-show #colorlib-main-nav {
visibility: visible;
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1); }
#colorlib-main-nav .logo {
font-size: 40px;
color: #fff;
text-transform: uppercase;
letter-spacing: 2px;
font-weight: 700;
position: relative;
display: inline-block;
margin-bottom: 0;
line-height: 1.5;
font-family: "Poppins", Arial, sans-serif; }
#colorlib-main-nav .logo span {
font-size: 14px;
display: block;
font-weight: 300;
color: rgba(255, 255, 255, 0.8);
letter-spacing: 8px; }
#colorlib-main-nav ul {
padding: 0;
margin: 0;
display: block; }
#media (max-width: 767.98px) {
#colorlib-main-nav ul {
padding: 20px 0 0 0; } }
#colorlib-main-nav ul li {
padding: 0;
margin: 0;
list-style: none;
font-weight: 600;
font-size: 14px;
letter-spacing: 5px;
text-transform: uppercase; }
#colorlib-main-nav ul li a {
display: block;
color: white;
padding: 5px 0; }
#colorlib-main-nav ul li a span {
color: white;
position: relative;
padding: 0 10px; }
#colorlib-main-nav ul li a span small {
position: absolute;
bottom: 7px;
left: -30px;
font-size: 16px;
color: rgba(255, 255, 255, 0.3);
border-bottom: 1px solid rgba(255, 255, 255, 0.3); }
#colorlib-main-nav ul li a:hover, #colorlib-main-nav ul li a:active, #colorlib-main-nav ul li a:focus {
outline: none;
text-decoration: none; }
#colorlib-main-nav ul li a:hover span:before, #colorlib-main-nav ul li a:active span:before, #colorlib-main-nav ul li a:focus span:before {
visibility: visible;
-webkit-transform: scaleX(1);
-moz-transform: scaleX(1);
-ms-transform: scaleX(1);
-o-transform: scaleX(1);
transform: scaleX(1); }
#colorlib-main-nav ul li.active a span {
color: #f8b500; }
#colorlib-main-nav ul li.active a span:before {
background: #fec771;
visibility: visible;
-webkit-transform: scaleX(1);
-moz-transform: scaleX(1);
-ms-transform: scaleX(1);
-o-transform: scaleX(1);
transform: scaleX(1); }
header {
padding: 2em 0;
position: absolute;
top: 0;
left: 0;
right: 0;
z-index: 9;
margin: 0 auto; }
#media (max-width: 767.98px) {
header {
padding: 1em 0;
position: absolute; } }
header .colorlib-navbar-brand {
float: left; }
header .colorlib-navbar-brand .colorlib-logo {
font-size: 12px;
color: #fff;
letter-spacing: 5px;
font-weight: 600;
position: relative;
display: inline-block;
margin-bottom: 0;
line-height: 1.5;
font-family: "Poppins", Arial, sans-serif;
text-transform: uppercase; }
header .colorlib-navbar-brand .colorlib-logo span {
font-size: 11px;
display: block;
font-weight: 300;
color: rgba(255, 255, 255, 0.8);
letter-spacing: 7px; }
header .colorlib-navbar-brand .colorlib-logo i {
color: #fec771;
position: absolute;
top: -18px;
bottom: 0;
left: 7px;
font-size: 48px; }
header .colorlib-navbar-brand .colorlib-logo:hover {
text-decoration: none !important; }
header .colorlib-navbar-brand .colorlib-logo:active, header .colorlib-navbar-brand .colorlib-logo:focus {
outline: none;
text-decoration: none; }
.colorlib-nav-toggle {
cursor: pointer;
text-decoration: none; }
.colorlib-nav-toggle.active i::before, .colorlib-nav-toggle.active i::after {
background: #000; }
.colorlib-nav-toggle.dark.active i::before, .colorlib-nav-toggle.dark.active i::after {
background: #000; }
.colorlib-nav-toggle:hover, .colorlib-nav-toggle:focus, .colorlib-nav-toggle:active {
outline: none;
border-bottom: none !important; }
.colorlib-nav-toggle i {
position: relative;
display: inline-block;
width: 20px;
height: 2px;
color: #000;
font: bold 14px/.4 Helvetica;
text-transform: uppercase;
text-indent: -55px;
background: #fff;
-webkit-transition: all .2s ease-out;
-o-transition: all .2s ease-out;
transition: all .2s ease-out; }
.menu-show .colorlib-nav-toggle i {
background: #fff;
color: #fff; }
.colorlib-nav-toggle i::before, .colorlib-nav-toggle i::after {
content: '';
width: 30px;
height: 2px;
background: #fff;
position: absolute;
left: 0;
-webkit-transition: 0.2s;
-o-transition: 0.2s;
transition: 0.2s; }
.menu-show .colorlib-nav-toggle i::before, .menu-show .colorlib-nav-toggle i::after {
background: #fff; }
#media (prefers-reduced-motion: reduce) {
.colorlib-nav-toggle i::before, .colorlib-nav-toggle i::after {
-webkit-transition: none;
-o-transition: none;
transition: none; } }
.colorlib-nav-toggle.dark i {
position: relative;
color: #fff;
background: #fff;
-webkit-transition: all .2s ease-out;
-o-transition: all .2s ease-out;
transition: all .2s ease-out; }
.colorlib-nav-toggle.dark i::before, .colorlib-nav-toggle.dark i::after {
background: #fff;
-webkit-transition: 0.2s;
-o-transition: 0.2s;
transition: 0.2s; }
#media (prefers-reduced-motion: reduce) {
.colorlib-nav-toggle.dark i::before, .colorlib-nav-toggle.dark i::after {
-webkit-transition: none;
-o-transition: none;
transition: none; } }
.colorlib-nav-toggle i::before {
top: -7px; }
.colorlib-nav-toggle i::after {
bottom: -7px; }
.colorlib-nav-toggle:hover i::before {
top: -10px; }
.colorlib-nav-toggle:hover i::after {
bottom: -10px; }
.colorlib-nav-toggle.active i {
background: transparent; }
.colorlib-nav-toggle.active i::before {
top: 0;
-webkit-transform: rotateZ(45deg);
-moz-transform: rotateZ(45deg);
-ms-transform: rotateZ(45deg);
-o-transform: rotateZ(45deg);
transform: rotateZ(45deg); }
.colorlib-nav-toggle.active i::after {
bottom: 0;
-webkit-transform: rotateZ(-45deg);
-moz-transform: rotateZ(-45deg);
-ms-transform: rotateZ(-45deg);
-o-transform: rotateZ(-45deg);
transform: rotateZ(-45deg); }
.colorlib-nav-toggle {
float: right;
z-index: 1003;
position: relative;
top: 0;
right: 0;
display: block;
margin: 0 auto;
cursor: pointer;
margin-top: 0; }
#media (max-width: 767.98px) {
.colorlib-nav-toggle {
right: 10px; } }
.hero-wrap {
background: #202020; }
.hero-wrap .slider-text .desc h1 {
font-size: 6vw;
font-weight: 700;
color: #fff;
text-transform: uppercase; }
.hero-wrap .slider-text .desc h3 {
color: rgba(255, 255, 255, 0.8);
font-size: 18px; }
.footer-basic {
padding:40px 0;
background-color:#000;
/*color:#6b6c6d;*/
}
.footer-basic .copyright {
margin-top:15px;
text-align:center;
font-size:13px;
color:rgb(255, 255, 255);
margin-bottom:0;
}
/* Header: https://epicbootstrap.com/snippets/footer-basic */
Adding justify-content: center; to your <h1> element will make it centered.
So in your CSS file you could do this:
h1 {
font-family: "cf_glitch_cityregular";
justify-content: center;
}
justify-content Property
Please add the justify-content-center class on <h1> to Align the center.
Updated code :
<h1 id="h-100" class="h-100 row col-12 align-items-center text-center display-1 w-100 justify-content-center">VIRTUAL REALITY</h1>

Circular menu with six equal divisions

I am trying to achieve six divisions of circular menu in here
(function(window) {
'use strict';
// class helper functions from bonzo https://github.com/ded/bonzo
function classReg(className) {
return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
}
// classList support for class management
// altho to be fair, the api sucks because it won't accept multiple classes at once
var hasClass, addClass, removeClass;
if ('classList' in document.documentElement) {
hasClass = function(elem, c) {
return elem.classList.contains(c);
};
addClass = function(elem, c) {
elem.classList.add(c);
};
removeClass = function(elem, c) {
elem.classList.remove(c);
};
} else {
hasClass = function(elem, c) {
return classReg(c).test(elem.className);
};
addClass = function(elem, c) {
if (!hasClass(elem, c)) {
elem.className = elem.className + ' ' + c;
}
};
removeClass = function(elem, c) {
elem.className = elem.className.replace(classReg(c), ' ');
};
}
function toggleClass(elem, c) {
var fn = hasClass(elem, c) ? removeClass : addClass;
fn(elem, c);
}
var classie = {
// full names
hasClass: hasClass,
addClass: addClass,
removeClass: removeClass,
toggleClass: toggleClass,
// short names
has: hasClass,
add: addClass,
remove: removeClass,
toggle: toggleClass
};
// transport
if (typeof define === 'function' && define.amd) {
// AMD
define(classie);
} else {
// browser global
window.classie = classie;
}
})(window);
// EventListener | #jon_neal | //github.com/jonathantneal/EventListener
!window.addEventListener && window.Element && (function() {
function addToPrototype(name, method) {
Window.prototype[name] = HTMLDocument.prototype[name] = Element.prototype[name] = method;
}
var registry = [];
addToPrototype("addEventListener", function(type, listener) {
var target = this;
registry.unshift({
__listener: function(event) {
event.currentTarget = target;
event.pageX = event.clientX + document.documentElement.scrollLeft;
event.pageY = event.clientY + document.documentElement.scrollTop;
event.preventDefault = function() {
event.returnValue = false
};
event.relatedTarget = event.fromElement || null;
event.stopPropagation = function() {
event.cancelBubble = true
};
event.relatedTarget = event.fromElement || null;
event.target = event.srcElement || target;
event.timeStamp = +new Date;
listener.call(target, event);
},
listener: listener,
target: target,
type: type
});
this.attachEvent("on" + type, registry[0].__listener);
});
addToPrototype("removeEventListener", function(type, listener) {
for (var index = 0, length = registry.length; index < length; ++index) {
if (registry[index].target == this && registry[index].type == type && registry[index].listener == listener) {
return this.detachEvent("on" + type, registry.splice(index, 1)[0].__listener);
}
}
});
addToPrototype("dispatchEvent", function(eventObject) {
try {
return this.fireEvent("on" + eventObject.type, eventObject);
} catch (error) {
for (var index = 0, length = registry.length; index < length; ++index) {
if (registry[index].target == this && registry[index].type == eventObject.type) {
registry[index].call(this, eventObject);
}
}
}
});
})();
* {
position: relative;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
list-style: none;
}
html,
body {
height: 100%;
}
body {
color: #fff;
}
.content-div {
position: relative;
margin-bottom: 3em;
height: 15em;
font-family: 'Lato', Arial, sans-serif;
}
.main_button {
position: absolute;
top: 100%;
left: 50%;
z-index: 11;
margin-top: -2.25em;
margin-left: -2.25em;
padding-top: 0;
width: 4.5em;
height: 4.5em;
border: none;
border-radius: 50%;
background: none;
background-color: #fff;
color: green;
text-align: center;
font-weight: 700;
font-size: 1.5em;
text-transform: uppercase;
cursor: pointer;
}
.csstransforms .main_wrapper {
position: absolute;
top: 100%;
left: 50%;
z-index: 10;
margin-top: -13em;
margin-left: -13.5em;
width: 27em;
height: 27em;
border-radius: 50%;
background: transparent;
opacity: 0;
-webkit-transition: all .3s ease 0.3s;
-moz-transition: all .3s ease 0.3s;
transition: all .3s ease 0.3s;
-webkit-transform: scale(0.1);
-ms-transform: scale(0.1);
-moz-transform: scale(0.1);
transform: scale(0.1);
pointer-events: none;
overflow: hidden;
}
.csstransforms .main_wrapper:after {
content: ".";
display: block;
font-size: 2em;
width: 6.2em;
height: 6.2em;
position: absolute;
left: 50%;
margin-left: -3.1em;
top: 50%;
margin-top: -3.1em;
border-radius: 50%;
z-index: 10;
color: transparent;
}
.csstransforms .opened-nav {
border-radius: 50%;
opacity: 1;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
transition: all .3s ease;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
pointer-events: auto;
}
.csstransforms .main_wrapper li {
position: absolute;
top: 50%;
left: 50%;
overflow: hidden;
margin-top: -1.3em;
margin-left: -10em;
width: 10em;
height: 10em;
font-size: 1.5em;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
transition: all .3s ease;
-webkit-transform: rotate(75deg) skew(62deg);
-moz-transform: rotate(75deg) skew(62deg);
-ms-transform: rotate(75deg) skew(62deg);
transform: rotate(75deg) skew(62deg);
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
transform-origin: 100% 100%;
pointer-events: none;
}
.csstransforms .main_wrapper li a {
position: absolute;
right: -7.25em;
bottom: -7.25em;
display: block;
width: 14.5em;
height: 14.5em;
border-radius: 50%;
background: green;
background: -webkit-radial-gradient(transparent 35%, green 35%);
background: -moz-radial-gradient(transparent 35%, green 35%);
background: radial-gradient(transparent 35%, green 35%);
color: #fff;
text-align: center;
text-decoration: none;
font-size: 1.2em;
line-height: 2;
-webkit-transform: skew(-62deg) rotate(-75deg) scale(1);
-moz-transform: skew(-62deg) rotate(-75deg) scale(1);
-ms-transform: skew(-62deg) rotate(-75deg) scale(1);
transform: skew(-62deg) rotate(-75deg) scale(1);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
pointer-events: auto;
}
.csstransforms .main_wrapper li a span {
position: relative;
top: 1em;
display: block;
font-size: .5em;
font-weight: 700;
text-transform: uppercase;
}
.csstransforms .main_wrapper li a:hover,
.csstransforms .main_wrapper li a:active,
.csstransforms .main_wrapper li a:focus {
background: -webkit-radial-gradient(transparent 35%, red 35%);
background: -moz-radial-gradient(transparent 35%, red 35%);
background: radial-gradient(transparent 35%, red 35%);
}
.csstransforms .opened-nav li {
-webkit-transition: all .3s ease .3s;
-moz-transition: all .3s ease .3s;
transition: all .3s ease .3s;
}
.csstransforms .opened-nav li:first-child {
-webkit-transform: skew(62deg);
-moz-transform: skew(62deg);
-ms-transform: skew(62deg);
transform: skew(62deg);
}
.csstransforms .opened-nav li:nth-child(2) {
-webkit-transform: rotate(30deg) skew(62deg);
-moz-transform: rotate(30deg) skew(62deg);
-ms-transform: rotate(30deg) skew(62deg);
transform: rotate(60deg) skew(62deg);
}
.csstransforms .opened-nav li:nth-child(3) {
-webkit-transform: rotate(60deg) skew(62deg);
-moz-transform: rotate(60deg) skew(62deg);
-ms-transform: rotate(60deg) skew(62deg);
transform: rotate(120deg) skew(62deg);
}
.csstransforms .opened-nav li:nth-child(4) {
-webkit-transform: rotate(90deg) skew(62deg);
-moz-transform: rotate(90deg) skew(62deg);
-ms-transform: rotate(90deg) skew(62deg);
transform: rotate(180deg) skew(62deg);
}
.csstransforms .opened-nav li:nth-child(5) {
-webkit-transform: rotate(120deg) skew(62deg);
-moz-transform: rotate(120deg) skew(62deg);
-ms-transform: rotate(120deg) skew(62deg);
transform: rotate(240deg) skew(62deg);
}
.csstransforms .opened-nav li:nth-child(6) {
-webkit-transform: rotate(150deg) skew(62deg);
-moz-transform: rotate(150deg) skew(62deg);
-ms-transform: rotate(150deg) skew(62deg);
transform: rotate(300deg) skew(62deg);
}
.no-csstransforms .main_wrapper {
overflow: hidden;
margin: 10em auto;
padding: .5em;
text-align: center;
}
.no-csstransforms .main_wrapper ul {
display: inline-block;
}
.no-csstransforms .main_wrapper li {
float: left;
width: 5em;
height: 5em;
background-color: #fff;
text-align: center;
font-size: 1em;
line-height: 5em;
}
.no-csstransforms .main_wrapper li a {
display: block;
width: 100%;
height: 100%;
color: inherit;
text-decoration: none;
}
.no-csstransforms .main_wrapper li a:hover,
.no-csstransforms .main_wrapper li a:active,
.no-csstransforms .main_wrapper li a:focus {
background-color: #f8f8f8;
}
.no-csstransforms .main_wrapper li.active a {
background-color: #6F325C;
color: #fff;
}
.no-csstransforms .main_button {
display: none;
}
#media only screen and (max-width: 620px) {
.no-csstransforms li {
width: 4em;
height: 4em;
line-height: 4em;
}
}
#media only screen and (max-width: 500px) {
.no-ccstransforms .main_wrapper {
padding: .5em;
}
.no-csstransforms .main_wrapper li {
width: 4em;
height: 4em;
font-size: .9em;
line-height: 4em;
}
}
#media only screen and (max-width: 480px) {
.csstransforms .main_wrapper {
font-size: .68em;
}
.main_button {
font-size: 1em;
}
}
#media only screen and (max-width:420px) {
.no-csstransforms .main_wrapper li {
width: 100%;
height: 3em;
line-height: 3em;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js"></script>
<div class="container">
<div class="content-div">
<button class="main_button" id="main_button">Content</button>
<div class="main_wrapper opened-nav" id="main_wrapper">
<ul>
<li><span>PIE 1</span></li>
<li><span>PIE 2</span></li>
<li><span>PIE 3</span></li>
<li><span>PIE 4</span></li>
<li><span>PIE 5</span></li>
<li><span>PIE 6</span></li>
</ul>
</div>
</div>
</div>
I couldn't adjust the size of each pie, as you can see huge gap in between each pie.
Please let me know how to adjust the size of pie?
Here is another idea based on this previous answer where you have CSS variables to easily control the gap and the size of your elements:
.palette {
--g: 10px; /* The gap between shapes*/
--s: 80px; /* the size*/
height: 300px;
width: 300px;
position: relative;
display: block;
margin:auto;
overflow: hidden;
}
.palette>* {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: var(--s) solid red;
border-radius: 50%;
clip-path: polygon(
calc(50% + var(--g)/2) 50%,
calc(50% + var(--g)/2) 0%,
100% 0%,
100% calc(21.13% - var(--g)/2),
50% calc(50% - var(--g)/2));
}
.palette>*:nth-child(1) {
transform: rotate(72deg);
}
.palette>*:nth-child(2) {
transform: rotate(144deg);
}
.palette>*:nth-child(3) {
transform: rotate(-72deg);
}
.palette>*:nth-child(4) {
transform: rotate(-144deg);
}
.palette a {
color: #fff;
display: block;
text-align: center;
transform: translate(42%, calc(-1*var(--s)/2)) rotate(35deg);
font-size: 20px;
}
.palette *:hover {
border-color:blue;
}
<div class="palette">
<div>link</div>
<div>link</div>
<div>link</div>
<div>link</div>
<div>link</div>
<div>link</div>
</div>

Toggle Menu list items display

I have a menu that I want to drop down when you click on the hamburger icon. The list items show up after the button is clicked, but is still seen when the button is not clicked. I can't figure out how to hide the menu.
I have the code here: Codepen
function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
$(document).ready(function() {
$('#nav-icon3').on('click', function() {
$(this).toggleClass('open');
});
});
* {
box-sizing: border-box;
}
html, body {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
font-size: 1rem;
}
.header {
background-color: #FFF;
width: 100%;
margin: 0px auto;
display: block;
top: 0;
margin-top: 7%;
height: 80px;
}
h1 {
margin-left: 5%;
padding-left: 1%;
font-family: 'Lobster', cursive;
margin-top: 0;
float: left;
margin-bottom: 0;
color: #D18E8F;
}
#nav-icon {
width: 30px;
height: 30px;
position: relative;
margin-right: 7%;
margin-top: 8px;
/*padding-right: 1%;*/
float: right;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: .5s ease-in-out;
-moz-transition: .5s ease-in-out;
-o-transition: .5s ease-in-out;
cursor: pointer;
}
#nav-icon3 span {
display: block;
position: absolute;
height: 4px;
width: 100%;
background: #8c8c8c;
border-radius: 6px;
opacity: 1;
left: 0;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: .25s ease-in-out;
-moz-transition: .25s ease-in-out;
-o-transition: .25s ease-in-out;
transition: .25s ease-in-out;
}
#nav-icon3 span:nth-child(1) {
top: 0px;
}
#nav-icon3 span:nth-child(2), #nav-icon3 span:nth-child(3) {
top: 10px;
}
#nav-icon3 span:nth-child(4) {
top: 20px;
}
#nav-icon3.open span:nth-child(1) {
top: 10px;
width: 0%;
left: 50%;
}
#nav-icon3.open span:nth-child(2) {
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
#nav-icon3.open span:nth-child(3) {
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
#nav-icon3.open span:nth-child(4) {
top: 10px;
width: 0%;
left: 50%;
}
.topnav.responsive {
/*display: none;*/
clear: both;
padding: 0;
height: 160px;
}
ul.topnav.responsive {
list-style: none;
font-family: 'Raleway', 'sans-serif';
float: left;
margin-left: 7%;
/*padding-left: 2%;*/
margin-top: 0;
width: 85%;
margin-bottom: 0;
}
ul.topnav.responsive li {
padding-top: 16px;
padding-bottom: 16px;
border-bottom: 1px solid #c6c6c6;
}
ul.topnav.responsive li a {
text-decoration: none;
color: #8c8c8c;
}
ul.topnav.responsive li a:hover {
color: #7EBEA3;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial scale=1.0">
<title>Gabriella Farfan</title>
<link href="https://fonts.googleapis.com/css?family=Lobster|Raleway" rel="stylesheet">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="http://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div class="header">
<h1>Gabriella Farfan</h1>
<div id="nav-icon">
<div id="nav-icon3">
<a id="nav-icon3" onclick="myFunction();">
<span></span>
<span></span>
<span></span>
<span></span>
</a>
</div>
</div>
<ul class="topnav" id="myTopnav">
<li>
Work
</li>
<li>
About Me
</li>
<li style="border-bottom: none">
Contact
</li>
</ul>
</div>
</body>
</html>
Just add .topnav { display: none; } and .topnav.responsive { display: block; } and your code will work fine.
.topnav {
display: none;
}
.topnav.responsive {
display: block;
clear: both;
padding: 0;
height: 160px;
}
You can also add this for make full hamburger clickable (not only line).
#nav-icon3 {
width: 30px;
height: 30px;
display: block;
}
Working fork of your code: Сodepen
I have made this little fix. Hope it helps.
CSS:
* {
box-sizing: border-box;
}
html, body {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
font-size: 1rem;
}
.header {
background-color: #FFF;
width: 100%;
margin: 0px auto;
display: block;
top: 0;
margin-top: 7%;
height: 80px;
}
h1 {
margin-left: 5%;
padding-left: 1%;
font-family: 'Lobster', cursive;
margin-top: 0;
float: left;
margin-bottom: 0;
color: #D18E8F;
}
#nav-icon {
width: 30px;
height: 30px;
position: relative;
margin-right: 7%;
margin-top: 8px;
/*padding-right: 1%;*/
float: right;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: .5s ease-in-out;
-moz-transition: .5s ease-in-out;
-o-transition: .5s ease-in-out;
cursor: pointer;
}
#nav-icon3 span {
display: block;
position: absolute;
height: 4px;
width: 100%;
background: #8c8c8c;
border-radius: 6px;
opacity: 1;
left: 0;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: .25s ease-in-out;
-moz-transition: .25s ease-in-out;
-o-transition: .25s ease-in-out;
transition: .25s ease-in-out;
}
#nav-icon3 span:nth-child(1) {
top: 0px;
}
#nav-icon3 span:nth-child(2), #nav-icon3 span:nth-child(3) {
top: 10px;
}
#nav-icon3 span:nth-child(4) {
top: 20px;
}
#nav-icon3.open span:nth-child(1) {
top: 10px;
width: 0%;
left: 50%;
}
#nav-icon3.open span:nth-child(2) {
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
#nav-icon3.open span:nth-child(3) {
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
#nav-icon3.open span:nth-child(4) {
top: 10px;
width: 0%;
left: 50%;
}
.responsive {
/*display: none;*/
clear: both;
padding: 0;
height: 160px;
}
ul.responsive {
list-style: none;
font-family: 'Raleway', 'sans-serif';
float: left;
margin-left: 7%;
/*padding-left: 2%;*/
margin-top: 0;
width: 85%;
margin-bottom: 0;
}
ul.responsive li {
padding-top: 16px;
padding-bottom: 16px;
border-bottom: 1px solid #c6c6c6;
}
ul.responsive li a {
text-decoration: none;
color: #8c8c8c;
}
ul.responsive li a:hover {
color: #7EBEA3;
}
.topnav{
display:none;
}
JS:
function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className = " responsive";
} else {
x.className = "topnav";
}
}
Please let me know if this is what you wanted.