I am new into web development, I am learning CSS right now. I have chosen as project for beginning my personal portfolio.
I am creating an easy navigation bar, I wanted to add hamburger Icon, but when I have added Icon to navbar the icon is stack at the bottom of the navbar and the animation(the lines are crossed like X, when button is toggled). I want the Icon in the left corner of the navbar.
I have tried to add the Icon outside the list, to nav but it overflow <h1> tag, so I have tried to add to <aside> parent, but it overflows the <h1> tag as well.
body {
background: linear-gradient(180deg, rgb(70, 65, 70), rgb(172, 34, 32));
}
.menu {
border: 2px solid white;
position: sticky;
display: flex;
flex-direction: row;
height: 95vh;
width: 17%;
background: linear-gradient(180deg, #241023ff, #6b0504ff);
/*linear-gradient(180deg, #2274a5ff, #f75c03ff);*/
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
transition: 0.5s;
}
.wrapper {
width: 100%;
margin: auto;
display: flex;
justify-content: flex-start;
}
.container {
margin-top: 10px;
width: 100%;
height: 25px;
margin-bottom: 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
cursor: pointer;
}
.menu-logo {
height: 3px;
width: 30px;
background-color: white;
}
.showmenu {
width: 25%;
}
/* #endregion Toggle button animation*/
/* #region Hover effect*/
nav:hover,
nav:active {
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
li a:hover,
li a:active {
font-weight: bold;
border: 1px solid white;
border-radius: 10px;
background: rgb(246, 246, 246);
transition: 0.5s;
}
li a:hover svg,
li a:active svg {
fill: #f75c03ff;
}
li a:hover span,
li a:active span {
color: #f75c03ff;
stroke: #f75c03ff;
}
/* #endregion Hover effect*/
nav {
width: 100%;
display: list-item;
text-align: center;
justify-content: center;
}
/* #region Welcome text*/
nav .welcome-text {
width: 100%;
margin-left: auto;
display: flex;
justify-content: center;
font-size: 3.5vw;
margin-bottom: 60px;
color: white;
text-align: center;
}
/* #endregion Welcome text*/
/* #region Main content*/
/* #region Wave animation*/
.wave {
width: 50%;
animation-name: wave-animation;
/* Refers to the name of your #keyframes element below */
animation-duration: 2.5s;
/* Change to speed up or slow down */
animation-iteration-count: infinite;
/* Never stop waving :) */
transform-origin: 70% 70%;
/* Pivot around the bottom-left palm */
display: inline-block;
}
#keyframes wave-animation {
0% {
transform: rotate( 0.0deg)
}
10% {
transform: rotate(14.0deg)
}
/* The following five values can be played with to make the waving more or less extreme */
20% {
transform: rotate(-8.0deg)
}
30% {
transform: rotate(14.0deg)
}
40% {
transform: rotate(-4.0deg)
}
50% {
transform: rotate(10.0deg)
}
60% {
transform: rotate( 0.0deg)
}
/* Reset for the last half to pause */
100% {
transform: rotate( 0.0deg)
}
}
/* #endregion Wave animation*/
nav ul {
width: 100%;
height: 100%;
display: list-item;
}
nav ul li {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
}
li a {
width: 100%;
height: 7%;
text-decoration: none;
display: flex;
text-align: left;
font-size: 100%;
justify-content: center;
margin-bottom: 10px;
}
li a span {
width: 100%;
font-size: 2.7vw;
align-self: center;
color: white;
margin-left: 10px;
}
li a svg {
width: 20%;
height: 20%;
}
<aside class="menu">
<div class="container nav-container">
<input class="checkbox" type="checkbox" name="" id="" />
<div class="hamburger-lines">
<span class="line line1"></span>
<span class="line line2"></span>
<span class="line line3"></span>
</div>
</div>
<nav>
<ul>
<li>
<h1 class="welcome-text">Welcome <span class="wave">👋</span></h1>
</li>
<li>
<a href="#">
<svg viewBox="0 0 24 24" fill="transparent" stroke="white" xmlns="http://www.w3.org/2000/svg">
<path
d="M21 8.77217L14.0208 1.79299C12.8492 0.621414 10.9497 0.621413 9.77817 1.79299L3 8.57116V23.0858H10V17.0858C10 15.9812 10.8954 15.0858 12 15.0858C13.1046 15.0858 14 15.9812 14 17.0858V23.0858H21V8.77217ZM11.1924 3.2072L5 9.39959V21.0858H8V17.0858C8 14.8767 9.79086 13.0858 12 13.0858C14.2091 13.0858 16 14.8767 16 17.0858V21.0858H19V9.6006L12.6066 3.2072C12.2161 2.81668 11.5829 2.81668 11.1924 3.2072Z" />
</svg>
<span>Home</span>
</a>
</li>
</ul>
</nav>
</aside>
Full code here:
https://jsfiddle.net/Lhawck59/
<div class="hamburger-lines">,
You didn't write a closing tag for this tag, so your code didn't work
you can add oppacity: 0; on the class menu, and add oppacity: 1; on the class showmenu
var logo = document.querySelector('.container');
var menu = document.querySelector('.menu');
logo.addEventListener('click',function(){
menu.classList.toggle('showmenu');
});
body {
background: linear-gradient(180deg, rgb(70, 65, 70), rgb(172, 34, 32));
}
.menu {
border: 2px solid white;
position: sticky;
display: flex;
flex-direction: row;
height: 95vh;
width: 17%;
background: linear-gradient(180deg, #241023ff, #6b0504ff);
/*linear-gradient(180deg, #2274a5ff, #f75c03ff);*/
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
transition: 0.5s;
opacity: 0;
}
/* #region Toggle button animation*/
.wrapper {
width: 100%;
margin: auto;
display: flex;
justify-content: flex-start;
}
.container {
margin-top: 10px;
width: 100%;
height: 25px;
margin-bottom: 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
cursor: pointer;
}
.menu-logo {
height: 3px;
width: 30px;
background-color: white;
}
.showmenu {
width: 25%;
opacity: 1;
}
/* #endregion Toggle button animation*/
/* #region Hover effect*/
nav:hover,
nav:active {
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
li a:hover,
li a:active {
font-weight: bold;
border: 1px solid white;
border-radius: 10px;
background: rgb(246, 246, 246);
transition: 0.5s;
}
li a:hover svg,
li a:active svg {
fill: #f75c03ff;
}
li a:hover span,
li a:active span {
color: #f75c03ff;
stroke: #f75c03ff;
}
/* #endregion Hover effect*/
nav {
width: 100%;
display: list-item;
text-align: center;
justify-content: center;
}
/* #region Welcome text*/
nav .welcome-text {
width: 100%;
margin-left: auto;
display: flex;
justify-content: center;
font-size: 3.5vw;
margin-bottom: 60px;
color: white;
text-align: center;
}
/* #endregion Welcome text*/
/* #region Main content*/
/* #region Wave animation*/
.wave {
width: 50%;
animation-name: wave-animation;
/* Refers to the name of your #keyframes element below */
animation-duration: 2.5s;
/* Change to speed up or slow down */
animation-iteration-count: infinite;
/* Never stop waving :) */
transform-origin: 70% 70%;
/* Pivot around the bottom-left palm */
display: inline-block;
}
#keyframes wave-animation {
0% {
transform: rotate(0.0deg)
}
10% {
transform: rotate(14.0deg)
}
/* The following five values can be played with to make the waving more or less extreme */
20% {
transform: rotate(-8.0deg)
}
30% {
transform: rotate(14.0deg)
}
40% {
transform: rotate(-4.0deg)
}
50% {
transform: rotate(10.0deg)
}
60% {
transform: rotate(0.0deg)
}
/* Reset for the last half to pause */
100% {
transform: rotate(0.0deg)
}
}
/* #endregion Wave animation*/
nav ul {
width: 100%;
height: 100%;
display: list-item;
}
nav ul li {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
}
li a {
width: 100%;
height: 7%;
text-decoration: none;
display: flex;
text-align: left;
font-size: 100%;
justify-content: center;
margin-bottom: 10px;
}
li a span {
width: 100%;
font-size: 2.7vw;
align-self: center;
color: white;
margin-left: 10px;
}
li a svg {
width: 20%;
height: 20%;
}
/* #endregion Main content*/
/* #region footer of navbar*/
ul li div {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 7%;
display: flex;
flex-direction: row;
text-align: left;
justify-content: flex-start;
}
li div img {
width: auto;
height: auto;
border-radius: 50%;
border: 2px solid white;
}
nav div span {
width: 100%;
font-size: 0;
align-self: center;
color: white;
margin-left: 10px;
font-weight: bolder;
}
/* #endregion footer of navbar*/
/*TEST*/
.nav-container {
display: flex;
justify-content: space-between;
align-items: left;
width: 5%;
}
.nav-container .checkbox {
position: absolute;
display: block;
width: 5%;
z-index: 5;
opacity: 0;
cursor: pointer;
}
.nav-container .hamburger-lines {
display: block;
height: 26px;
width: 32px;
position: absolute;
z-index: 2;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.nav-container .hamburger-lines .line {
display: block;
height: 4px;
width: 100%;
border-radius: 10px;
background: rgb(255, 255, 255);
}
.nav-container .hamburger-lines .line1 {
transform-origin: 0% 0%;
transition: transform 0.4s ease-in-out;
}
.nav-container .hamburger-lines .line2 {
transition: transform 0.2s ease-in-out;
}
.nav-container .hamburger-lines .line3 {
transform-origin: 0% 100%;
transition: transform 0.4s ease-in-out;
}
.nav-container input[type="checkbox"]:checked ~ .menu-items {
transform: translateX(0);
}
.nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line1 {
transform: rotate(45deg);
}
.nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line2 {
transform: scaleY(0);
}
.nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line3 {
transform: rotate(-45deg);
}
.nav-container input[type="checkbox"]:checked ~ .logo{
display: none;
}
*{
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: 'Roboto', sans-serif;
/*font-family: 'Noto Sans', sans-serif;*/
}
header{
border: 1px solid black;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/content/content.css">
<link rel="stylesheet" href="css/navbar/navbar.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght#0,100;0,700;1,300;1,500&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="css/navbar/hamburgerIcon/hamburgerIcon.css">
<title>Portfolio</title>
</head>
<body>
<header>
<h1>Header</h1>
<div class="container nav-container">
<input class="checkbox" type="checkbox" name="" id="" />
<div class="hamburger-lines">
<span class="line line1"></span>
<span class="line line2"></span>
<span class="line line3"></span>
</div>
</header>
<aside class="menu">
<nav>
<ul>
<li>
<h1 class="welcome-text">Welcome <span class="wave">👋</span></h1>
</li>
<li>
<a href="#">
<svg viewBox="0 0 24 24" fill="transparent" stroke="white" xmlns="http://www.w3.org/2000/svg">
<path d="M21 8.77217L14.0208 1.79299C12.8492 0.621414 10.9497 0.621413 9.77817 1.79299L3 8.57116V23.0858H10V17.0858C10 15.9812 10.8954 15.0858 12 15.0858C13.1046 15.0858 14 15.9812 14 17.0858V23.0858H21V8.77217ZM11.1924 3.2072L5 9.39959V21.0858H8V17.0858C8 14.8767 9.79086 13.0858 12 13.0858C14.2091 13.0858 16 14.8767 16 17.0858V21.0858H19V9.6006L12.6066 3.2072C12.2161 2.81668 11.5829 2.81668 11.1924 3.2072Z" />
</svg>
<span>Home</span>
</a>
</li>
<li>
<a href="#">
<svg fill="transparent" stroke="white" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M21 2H6a2 2 0 0 0-2 2v3H2v2h2v2H2v2h2v2H2v2h2v3a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1zm-8 2.999c1.648 0 3 1.351 3 3A3.012 3.012 0 0 1 13 11c-1.647 0-3-1.353-3-3.001 0-1.649 1.353-3 3-3zM19 18H7v-.75c0-2.219 2.705-4.5 6-4.5s6 2.281 6 4.5V18z" />
</svg>
<span>Contact</span>
</a>
</li>
<li>
<a href="#">
<svg fill="transparent" stroke="white" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17 7C17 5.34315 15.6569 4 14 4H10C8.34315 4 7 5.34315 7 7H6C4.34315 7 3 8.34315 3 10V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V10C21 8.34315 19.6569 7 18 7H17ZM14 6H10C9.44772 6 9 6.44772 9 7H15C15 6.44772 14.5523 6 14 6ZM6 9H18C18.5523 9 19 9.44772 19 10V18C19 18.5523 18.5523 19 18 19H6C5.44772 19 5 18.5523 5 18V10C5 9.44772 5.44772 9 6 9Z" />
</svg>
<span>My work</span>
</a>
</li>
<li>
<a href="#">
<svg fill="transparent" stroke="white" xmlns="http://www.w3.org/2000/svg" class="bi bi-chat-dots-fill" viewBox="0 0 16 16">
<path d="M16 8c0 3.866-3.582 7-8 7a9.06 9.06 0 0 1-2.347-.306c-.584.296-1.925.864-4.181 1.234-.2.032-.352-.176-.273-.362.354-.836.674-1.95.77-2.966C.744 11.37 0 9.76 0 8c0-3.866 3.582-7 8-7s8 3.134 8 7zM5 8a1 1 0 1 0-2 0 1 1 0 0 0 2 0zm4 0a1 1 0 1 0-2 0 1 1 0 0 0 2 0zm3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" />
</svg>
<span>References</span>
</a>
</li>
<li>
<a href="#">
<svg xmlns="http://www.w3.org/2000/svg" fill="white" class="bi bi-person-circle" viewBox="0 0 16 16">
<path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z" />
<path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1z" />
</svg>
<span>About</span>
</a>
</li>
</ul>
</nav>
</aside>
<script src="js/script.js"></script>
</body>
</html>
Related
I actually have some styles that allow me to display a text surrounded by lines. The text can be displayed horizontally or vertically. I would like to add an arrow a the end of the surrounding lines. Something like this:
------------------------- My horizontal label ------------------------>
or
^
|
|
M
y
t
e
x
t
|
|
My vertical text is displayed differently in my following example.
I tried several Technics i found in the net but no way to make it work in horizontal and vertical context.
Someone has an idea of how it can be implemented?
This is my starting css in which i would like to add these arrows:
h1 {
display: flex;
flex-direction: row;
}
h1:before, h1:after{
content: "";
flex: 1 1;
border-bottom: 1px solid;
margin: auto;
}
h1:before {
margin-right: 10px
}
h1:after {
margin-left: 10px
}
h2 {
display: flex;
flex-direction: row;
writing-mode: vertical-rl;
transform: scale(-1);
text-align: -webkit-center;
height: 100%;
}
h2:before, h2:after{
content: "";
flex: 1 1;
border-right: 1px solid;
margin: auto;
}
h2:before {
margin-bottom: 10px
}
h2:after {
margin-top: 10px
}
<h1>My horizontal text</h1>
<h2>My vertical text</h2>
Thank you for your solution. I tried this that seems to be nice too:
.line-container {
display: flex;
width: 100%;
margin: 20px auto;
align-items: center;
}
.line {
flex-grow: 1;
height: 2px;
background: black;
position: relative;
}
.line.arrow-right:after {
position: absolute;
content: '';
bottom: -4px;
right: -1px;
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 10px solid black;
}
.line-container span.label {
margin: 0 10px;
}
.line-container-vertical {
display: flex;
height: 100%;
margin: auto 20px;
align-items: center;
writing-mode: vertical-rl;
transform: scale(-1);
}
.line-vertical {
flex-grow: 1;
width: 2px;
background: black;
position: relative;
}
.line-vertical.arrow-top:after {
position: absolute;
content: '';
bottom: -2px;
left: -4px;
width: 0;
height: 0;
border-top: 10px solid black;
border-right: 5px solid transparent;
border-left: 5px solid transparent;
}
.line-container-vertical span.label {
margin: 10px 0;
}
<div class="line-container">
<span class="line arrow-left"></span>
<span class="label">Horizontal Label</span>
<span class="line arrow-right"></span>
</div>
<div class="line-container-vertical">
<span class="line-vertical"></span>
<span class="label">Vertical Label</span>
<span class="line-vertical arrow-top"></span>
</div>
What do you think?
[EDIT 20221125 - Added an alternative approach]
I am not all sure that your approach is the best, but based on your approach, the following might be of use:
h1 {
display: flex;
flex-direction: row;
}
h1 > div:nth-of-type(1) {
margin-right: -0.05em;
}
h1 > div:nth-of-type(2),
h1 > div:nth-of-type(4) {
flex: 1 1;
border-bottom: 0.05em solid;
margin: auto;
padding-top: 0.17em;
}
h1 > div:nth-of-type(3) {
margin-right: 10px;
margin-left: 10px;
}
h1 > div:nth-of-type(5) {
margin-left: -0.05em;
}
h2 {
display: flex;
flex-direction: row;
writing-mode: vertical-rl;
transform: scale(-1);
height: 100%;
}
h2 > div:nth-of-type(1) {
margin-bottom: -0.05em;
}
h2 > div:nth-of-type(2),
h2 > div:nth-of-type(4) {
flex: 1 1;
border-left: 0.05em solid;
margin: auto;
padding-left: 0.17em;
margin-top: -0.05em;
margin-bottom: -0.05em;
}
h2 > div:nth-of-type(3) {
margin-top: 10px;
margin-bottom: 10px;
}
h2 > div:nth-of-type(5) {
margin-bottom: -0.05em;
}
<h1><div>←</div><div></div><div>My horizontal text</div><div></div><div>→</div></h1>
<h2><div>←</div><div></div><div>My vertical text</div><div></div><div>→</div></h2>
The following is an alternative approach and should be more robust:
.horizontal {
display: flex;
flex-direction: row;
justify-content: space-between;
background-repeat: repeat-x;
background-position-y: center;
background-image: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 20 3"><line x1="0" y1="1" x2="20" y2="1" stroke="black" stroke-width="3" /></svg>');
background-size: 100% 0.2em;
}
.horizontal > span {
background: white;
padding-left: 10px;
padding-right: 10px;
font-weight: bold;
}
leftarrow {
content: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" height="1.1em" viewBox="0 0 40 14"><line x1="0" y1="7" x2="38" y2="2" stroke="black" stroke-width="2" /><line x1="0" y1="7" x2="38" y2="12" stroke="black" stroke-width="2" /></svg>');
}
rightarrow {
content: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" height="1.1em" viewBox="0 0 40 14"><line x1="1" y1="2" x2="39" y2="7" stroke="black" stroke-width="2" /><line x1="1" y1="12" x2="39" y2="7" stroke="black" stroke-width="2" /></svg>');
}
<div class="horizontal"><leftarrow></leftarrow><span>Horizontally aligned text</span><rightarrow></rightarrow></div>
How do I shift the content over to the next row when browser width is 915px?
This is what I have now:
<div class="body">
<div class="container">
<div class="card">
<div class="box">
<div class="percent">
<svg>
<circle cx="70" cy="70" r="70"></circle>
<circle cx="70" cy="70" r="70"></circle>
</svg>
<div class="number">
<h2>90<span>%</span></h2>
</div>
</div>
<h2 class="text">Html</h2>
</div>
</div>
<div class="card">
<div class="box">
<div class="percent">
<svg>
<circle cx="70" cy="70" r="70"></circle>
<circle cx="70" cy="70" r="70"></circle>
</svg>
<div class="number">
<h2>85<span>%</span></h2>
</div>
</div>
<h2 class="text">CSS</h2>
</div>
</div>
<div class="card">
<div class="box">
<div class="percent">
<svg>
<circle cx="70" cy="70" r="70"></circle>
<circle cx="70" cy="70" r="70"></circle>
</svg>
<div class="number">
<h2>60<span>%</span></h2>
</div>
</div>
<h2 class="text">Javascript</h2>
</div>
</div>
</div>
</div>
And my css
.body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.container {
display: flex;
justify-content: space-around;
}
.container .card {
margin-left: 20px;
position: relative;
width: 250px;
background: #222;
background: linear-gradient(0deg, #1b1b1b, #222, #1b1b1b);
display: flex;
justify-content: center;
align-items: center;
height: 300px;
border-radius: 4px;
text-align: center;
overflow: hidden;
transition: 0.5s;
}
.container .card:hover {
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
transform: translateY(-10px);
}
.container .card:before {
content: "";
position: absolute;
top: 0;
left: -50%;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.03);
pointer-events: none;
z-index: 1;
}
.percent {
position: relative;
width: 150px;
height: 150px;
border-radius: 50%;
box-shadow: inset 0 0 50px #000;
background: #222;
z-index: 100;
}
.percent .number {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
}
.percent .number h2 {
color: #777;
font-weight: 700;
font-size: 40px;
transition: 0.5s;
}
.card:hover .percent .number h2 {
color: #fff;
font-size: 60px;
}
.percent .number h2 span {
font-size: 24px;
color: #777;
}
.text {
color: #777;
margin-top: 20px;
font-weight: 700;
font-size: 18px;
letter-spacing: 1px;
text-transform: uppercase;
transition: 0.5s;
}
.card:hover .text {
color: #fff;
}
svg {
position: relative;
width: 150px;
height: 150px;
z-index: 1000;
}
circle {
width: 100%;
height: 100%;
fill: none;
stroke: #191919;
stroke-width: 10;
stroke-linecap: round;
transform: translate(5px, 5px);
}
circle:nth-child(2) {
stroke-dasharray: 440;
stroke-dashoffset: 440;
}
.card:nth-child(1) svg circle:nth-child(2) {
stroke-dashoffset: calc(440 - (440 * 90) / 100);
stroke: #00ff43;
}
.card:nth-child(2) svg circle:nth-child(2) {
stroke-dashoffset: calc(440 - (440 * 85) / 100);
stroke: #00a1ff;
}
.card:nth-child(3) svg circle:nth-child(2) {
stroke-dashoffset: calc(440 - (440 * 60) / 100);
stroke: #c104ff;
}
#media only screen and (max-width: 915px) {
/* your css of 1024 px screen size */
.card {
flex: 10% !important;
}
}
How do I make the content shift downwards when on 915px browser width so it looks good on mobile. I've tried flex, change display, change width but nothing works. I don't know if it has to do with any of that but I'd appreciate the help.
You can use the grid layout. First, set the container to display: grid;. After you can set how your grid will be with the grid-template-columns: 1fr; (1fr = one column, 1fr 1fr = 2 column, 1fr 2fr = 2 column, but the right one is bigger... etc). After that, you can add gap: 1rem; to have a gap between you column and row.
The Grid Documentation on W3School
Here is a example:
.body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.container {
display: flex;
justify-content: space-around;
}
.container .card {
margin-left: 20px;
position: relative;
width: 250px;
background: #222;
background: linear-gradient(0deg, #1b1b1b, #222, #1b1b1b);
display: flex;
justify-content: center;
align-items: center;
height: 300px;
border-radius: 4px;
text-align: center;
overflow: hidden;
transition: 0.5s;
}
.container .card:hover {
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
transform: translateY(-10px);
}
.container .card:before {
content: "";
position: absolute;
top: 0;
left: -50%;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.03);
pointer-events: none;
z-index: 1;
}
.percent {
position: relative;
width: 150px;
height: 150px;
border-radius: 50%;
box-shadow: inset 0 0 50px #000;
background: #222;
z-index: 100;
}
.percent .number {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
}
.percent .number h2 {
color: #777;
font-weight: 700;
font-size: 40px;
transition: 0.5s;
}
.card:hover .percent .number h2 {
color: #fff;
font-size: 60px;
}
.percent .number h2 span {
font-size: 24px;
color: #777;
}
.text {
color: #777;
margin-top: 20px;
font-weight: 700;
font-size: 18px;
letter-spacing: 1px;
text-transform: uppercase;
transition: 0.5s;
}
.card:hover .text {
color: #fff;
}
svg {
position: relative;
width: 150px;
height: 150px;
z-index: 1000;
}
circle {
width: 100%;
height: 100%;
fill: none;
stroke: #191919;
stroke-width: 10;
stroke-linecap: round;
transform: translate(5px, 5px);
}
circle:nth-child(2) {
stroke-dasharray: 440;
stroke-dashoffset: 440;
}
.card:nth-child(1) svg circle:nth-child(2) {
stroke-dashoffset: calc(440 - (440 * 90) / 100);
stroke: #00ff43;
}
.card:nth-child(2) svg circle:nth-child(2) {
stroke-dashoffset: calc(440 - (440 * 85) / 100);
stroke: #00a1ff;
}
.card:nth-child(3) svg circle:nth-child(2) {
stroke-dashoffset: calc(440 - (440 * 60) / 100);
stroke: #c104ff;
}
#media only screen and (max-width: 915px) {
/* your css of 1024 px screen size */
.card {
flex: 10% !important;
}
.grid-class{
display: grid;
grid-template-columns: 1fr;
gap: 1rem;
}
}
<div class="body">
<div class="container grid-class">
<div class="card">
<div class="box">
<div class="percent">
<svg>
<circle cx="70" cy="70" r="70"></circle>
<circle cx="70" cy="70" r="70"></circle>
</svg>
<div class="number">
<h2>90<span>%</span></h2>
</div>
</div>
<h2 class="text">Html</h2>
</div>
</div>
<div class="card">
<div class="box">
<div class="percent">
<svg>
<circle cx="70" cy="70" r="70"></circle>
<circle cx="70" cy="70" r="70"></circle>
</svg>
<div class="number">
<h2>85<span>%</span></h2>
</div>
</div>
<h2 class="text">CSS</h2>
</div>
</div>
<div class="card">
<div class="box">
<div class="percent">
<svg>
<circle cx="70" cy="70" r="70"></circle>
<circle cx="70" cy="70" r="70"></circle>
</svg>
<div class="number">
<h2>60<span>%</span></h2>
</div>
</div>
<h2 class="text">Javascript</h2>
</div>
</div>
</div>
</div>
$(document).ready(function(){
//Check to see if the window is top if not then display button
$(window).scroll(function(){
if ($(this).scrollTop() > $(window).height()) {
$('#scroll-top').fadeIn(300);
$('#scroll-top').css('display', 'flex');
} else {
$('#scroll-top').fadeOut(300);
}
});
//Click event to scroll to top
$('#scroll-top').click(function(){
$('html, body').animate({scrollTop : 0},800);
return false;
});
//If Cookie-container is visable add bottom value
if ($("#cookie-notification-container").is(':visible')){
$("#scroll-top").css('bottom', 80 + 'px');
} else {
$("#scroll-top").css('bottom', '20px');}
});
/* ======================================================
► SCROLL-TOP
====================================================== */
#scroll-top{
display: none;
justify-content: center;
align-items: center;
position: fixed;
bottom: 20px;
right: 20px;
z-index: 99;
border: none;
outline: none;
background: -webkit-linear-gradient(45deg, #ff91a2 0%,#ffabb7 100%);
background: <?= $headerBackgroundColor; ?>;
color: #fff;
cursor: pointer;
border-radius: 100%;
font-size: 18px;
box-shadow: 0px 6px 10px -5px rgba(0, 0, 0, 0.2);
width: 50px;
height: 50px;
overflow: hidden;
}
#scroll-top::after{
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.0);
border-radius: 100%;
z-index: -1;
transform: scale(0);
transform-origin: center;
transition: transform 0.25s, border-radius 0.25s, background 0.25s;
}
#scroll-top:hover::after{
transform: scale(1);
border-radius: 100%;
transform-origin: center;
background: rgba(255,255,255,0.15);
}
#scroll-top svg{
transform: translateY(0%);
opacity: 1;
animation: fade-up 0.4s ease-out;
animation-delay: 0.2s;
animation-fill-mode: backwards;
fill:#ffffff;
}
#keyframes fade-up{
0%{transform: translateY(80%); opacity:0 ;}
80%{opacity:1 ;}
100%{transform: translateY(0%); opacity:1 ;}
}
/* ======================================================
► CREDITS
====================================================== */
#credits-container{
background: #2D2C2B;
min-height: 60px;
width: 100%;
display: flex;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
box-sizing: inherit;
}
#credits-container .wrapper #credits{
height: 100%;
width: 100%;
min-height: 60px;
display: inline-flex;
justify-content: center;
align-items: center;
text-align: center;
padding: 20px;
}
#credits-container .wrapper #credits p{
color: rgba(255,255,255,0.6);
letter-spacing: 0.005em;
font-size: 0.95em;
line-height: 1.2;
display: block;
margin: 0em 0;
margin-block-start: 0em;
margin-block-end: 0em;
margin-inline-start: 0px;
margin-inline-end: 0px;
text-align:center;
}
#media only screen and (max-width: 960px) {
#credits-container .wrapper #credits p{
font-size: 0.90em;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div style="height: 2000px;">
<button id="scroll-top" onclick="topFunction()">
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 460" width="15" height="15">
<path d="M782.45,357.08l-340-340a60.07,60.07,0,0,0-84.86,0l-340,340a60,60,0,0,0,84.86,84.86L400,144.35,697.59,441.94a60,60,0,0,0,84.86-84.86Z" transform="translate(0 0.49)"/>
</svg>
</button>
</div>
<div id="credits-container">
<div class="wrapper">
<div id="credits">
<p>Created by Jhon Doh - ©<?= date("Y");?> Test Design.</p>
</div>
</div>
</div>
I have a scroll to top button that I would like to stick above the footer/credits (let it float 20 px above the credits/footer). When I apply sticky instead of fixed it does not work properly. I was wondering if someone could help me out. I am pretty new with this stuff. I have tried something similar with the cookie notification in the script(See below). But it is a bad temporary solution.
When focusing in search input search input is growing left and not covering on the svg icon. But focusing out input is shrinking to the right to be covering the svg icon. I want to the same animation as focusing in (to be reversed) without covering the svg icon. I can start background-color animation to earlier. But I don't want to solve this problem to changing background-color animation time. How can I solve it?
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
font-size: 62.5%;
box-sizing: border-box;
}
body {
font-family: "Roboto", sans-serif;
font-weight: 400;
line-height: 1.6;
}
.wrap {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-end;
height: 5rem;
width: 100%;
background-color: orangered;
background: #6f42c1;
background: linear-gradient(30deg, #6f42c1 35%, #6610f2 75%, #007bff 100%);
box-shadow: 0px 5px 5px -5px rgba(0, 0, 0, 0.75);
margin-top:5rem;
}
.search-3 {
margin-right: 2rem;
display: inline-block;
position: relative;
height: 3rem;
width: 0;
}
.search-3__text {
display: inline-block;
height: 3rem;
width: 3rem;
background-color: transparent;
border: none;
outline: none;
border-radius: 2px;
font-family: "Roboto Slab", serif;
font-size: 1.6rem;
font-weight: 400;
color: #000;
position: absolute;
top: 0;
right: 0;
z-index: 5;
cursor: pointer;
transition: width 0.4s cubic-bezier(0, 0.795, 0, 1) 0s, background-color 0.2s ease-out 0.4s;
}
.search-3__text::placeholder {
color: transparent;
font-size: 1.5rem;
font-weight: 300;
font-style: italic;
transition: color 0s ease-in-out 0s;
}
.search-3__text:focus {
width: 50rem;
z-index: 3;
cursor: text;
background-color: #fff;
transition: width 0.4s cubic-bezier(0, 0.795, 0, 1) 0.2s, background-color 0.2s ease-in-out 0s;
}
.search-3__text:focus::placeholder {
color: #000;
transition: color 0.2s ease-in-out 0.5s;
}
.search-3__icon {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
height: 3rem;
width: 3rem;
border: none;
position: absolute;
top: 0;
right: 0;
z-index: 4;
cursor: pointer;
}
.search-3__icon svg {
display: inline-block;
height: 2rem;
width: 2rem;
color: #000;
filter: drop-shadow(2px 1px 1px #7A8288);
}
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab:400,700|Roboto:400,400i,700&subset=latin-ext" rel="stylesheet">
</head>
<body>
<svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-search" viewBox="0 0 26 28">
<title>search</title>
<path d="M18 13c0-3.859-3.141-7-7-7s-7 3.141-7 7 3.141 7 7 7 7-3.141 7-7zM26 26c0 1.094-0.906 2-2 2-0.531 0-1.047-0.219-1.406-0.594l-5.359-5.344c-1.828 1.266-4.016 1.937-6.234 1.937-6.078 0-11-4.922-11-11s4.922-11 11-11 11 4.922 11 11c0 2.219-0.672 4.406-1.937 6.234l5.359 5.359c0.359 0.359 0.578 0.875 0.578 1.406z">
</path>
</symbol>
</defs>
</svg>
<div class="wrap">
<form class="search-3" action="" autocomplete="on">
<input class="search-3__text" id="search-3" name="search-3" type="text" placeholder="Sitede ara.." page_search onfocusout="if(this.value !=''){this.value='';}">
<span class="search-3__icon">
<svg>
<use xlink:href="#icon-search" />
</svg>
</span>
</form>
</div>
</body>
Here's one method.
Don't rely on changing z-index while animating the text input.
Instead, set the icon to pointer-events: none so that the clicks pass through it to the text box underneath.
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
font-size: 62.5%;
box-sizing: border-box;
}
body {
font-family: "Roboto", sans-serif;
font-weight: 400;
line-height: 1.6;
}
.wrap {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-end;
height: 5rem;
width: 100%;
background-color: orangered;
background: #6f42c1;
background: linear-gradient(30deg, #6f42c1 35%, #6610f2 75%, #007bff 100%);
box-shadow: 0px 5px 5px -5px rgba(0, 0, 0, 0.75);
margin-top:5rem;
}
.search-3 {
margin-right: 2rem;
display: inline-block;
position: relative;
height: 3rem;
width: 0;
}
.search-3__text {
display: inline-block;
height: 3rem;
width: 3rem;
background-color: transparent;
border: none;
outline: none;
border-radius: 2px;
font-family: "Roboto Slab", serif;
font-size: 1.6rem;
font-weight: 400;
color: #000;
position: absolute;
top: 0;
right: 0;
cursor: pointer;
transition: width 0.4s cubic-bezier(0, 0.795, 0, 1) 0s, background-color 0.2s ease-out 0.4s;
}
.search-3__text::placeholder {
color: transparent;
font-size: 1.5rem;
font-weight: 300;
font-style: italic;
transition: color 0s ease-in-out 0s;
}
.search-3__text:focus {
width: 50rem;
cursor: text;
background-color: #fff;
transition: width 0.4s cubic-bezier(0, 0.795, 0, 1) 0.2s, background-color 0.2s ease-in-out 0s;
}
.search-3__text:focus::placeholder {
color: #000;
transition: color 0.2s ease-in-out 0.5s;
}
.search-3__icon {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
height: 3rem;
width: 3rem;
border: none;
position: absolute;
top: 0;
right: 0;
cursor: pointer;
pointer-events: none;
}
.search-3__icon svg {
display: inline-block;
height: 2rem;
width: 2rem;
color: #000;
filter: drop-shadow(2px 1px 1px #7A8288);
}
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab:400,700|Roboto:400,400i,700&subset=latin-ext" rel="stylesheet">
</head>
<body>
<svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-search" viewBox="0 0 26 28">
<title>search</title>
<path d="M18 13c0-3.859-3.141-7-7-7s-7 3.141-7 7 3.141 7 7 7 7-3.141 7-7zM26 26c0 1.094-0.906 2-2 2-0.531 0-1.047-0.219-1.406-0.594l-5.359-5.344c-1.828 1.266-4.016 1.937-6.234 1.937-6.078 0-11-4.922-11-11s4.922-11 11-11 11 4.922 11 11c0 2.219-0.672 4.406-1.937 6.234l5.359 5.359c0.359 0.359 0.578 0.875 0.578 1.406z">
</path>
</symbol>
</defs>
</svg>
<div class="wrap">
<form class="search-3" action="" autocomplete="on">
<input class="search-3__text" id="search-3" name="search-3" type="text" placeholder="Sitede ara.." page_search onfocusout="if(this.value !=''){this.value='';}">
<span class="search-3__icon">
<svg>
<use xlink:href="#icon-search" />
</svg>
</span>
</form>
</div>
</body>
I've made animated scroll to up button. When user hover on the button, up arrow animation plays in side of the button. I've add overflow:hidden; code for hidden overflowed arrow animation out side the button area. This approach works on chrome, opera, firefox. But outside the button arrow animation don't hide on macOs safari. How can i hide arrow animation out side the button area on macOs safari.
Sass(Scss)
// COLOR VARIABLES
$color-white: #fff;
$color-gray-100: #f8f9fa;
$color-gray-200: #e9ecef;
$color-gray-300: #dee2e6;
$color-gray-400: #ced4da;
$color-gray-500: #999;
$color-gray-600: #7A8288;
$color-gray-700: #52575C;
$color-gray-800: #3A3F44;
$color-gray-900: #272B30;
$color-black: #000;
$sidebar_opacity: 0.9;
#mixin flex-vCenter($justify-content:center) {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: $justify-content;
}
////////////////// Animation //////////////////
#keyframes move_up {
from {
transform: translateY(4rem);
}
to {
transform: translateY(-4rem);
}
}
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
// This defines what 1rem is
font-size: 62.5%; //1 rem = 10px; 10px/16px = 62.5%
box-sizing: border-box;
}
body {
font-weight: 400;
line-height: 1.6;
background-color: $color-gray-300;
}
.wrapper{
position: relative;
height: 50rem;
width: 50rem;
top:1rem;
left:10rem;
background-color: $color-gray-600;
& &__scroll_top {
position: absolute;
bottom: 3rem;
right: 3rem;
}
}
.scroll_top__btn {
&,
&:link,
&:visited {
#include flex-vCenter;
cursor: pointer;
opacity: $sidebar_opacity - .5;
background-color: $color-gray-200;
height: 4.5rem;
width: 4.5rem;
display: block;
border-radius: 5px;
transition: all .2s;
//Change for the <button> element
border: none;
overflow:hidden;
}
&:hover {
transform: translateY(-5px);
opacity: $sidebar_opacity;
}
&:active,
&:focus {
outline: none;
transform: translateY(-1px);
}
&-icon{
height: 2.5rem;
width: 2.5rem;
fill: $color-gray-900;
filter: drop-shadow( 0 5px 2px rgba($color-black, .5));
}
&:hover &-icon{
animation: move_up .5s linear infinite;
}
}
#keyframes move_up {
from {
transform: translateY(4rem);
}
to {
transform: translateY(-4rem);
}
}
*, *::after, *::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
font-size: 62.5%;
box-sizing: border-box;
}
body {
font-weight: 400;
line-height: 1.6;
background-color: #dee2e6;
}
.wrapper {
position: relative;
height: 50rem;
width: 50rem;
top: 1rem;
left: 10rem;
background-color: #7a8288;
}
.wrapper .wrapper__scroll_top {
position: absolute;
bottom: 3rem;
right: 3rem;
}
.scroll_top__btn, .scroll_top__btn:link, .scroll_top__btn:visited {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0.4;
background-color: #e9ecef;
height: 4.5rem;
width: 4.5rem;
display: block;
border-radius: 5px;
transition: all 0.2s;
border: none;
overflow: hidden;
}
.scroll_top__btn:hover {
transform: translateY(-5px);
opacity: 0.9;
}
.scroll_top__btn:active, .scroll_top__btn:focus {
outline: none;
transform: translateY(-1px);
}
.scroll_top__btn-icon {
height: 2.5rem;
width: 2.5rem;
fill: #272b30;
filter: drop-shadow(0 5px 2px rgba(0, 0, 0, .5));
}
.scroll_top__btn:hover .scroll_top__btn-icon {
animation: move_up 0.5s linear infinite;
}
<svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-arrow-up" viewBox="0 0 32 32">
<title>arrow-up</title>
<path d="M16 1l-15 15h9v16h12v-16h9z"></path>
</symbol>
</defs>
</svg>
<div class="wrapper">
<div class="wrapper__scroll_top">
<button class="scroll_top__btn" type="button">
<svg class="scroll_top__btn-icon">
<use xlink:href="#icon-arrow-up" />
</svg>
</button>
</div>
</div>
Here's the solution, I've simplified the syntax for you a little bit
This is your SCSS, the code snippet has its compiled form
// COLOR VARIABLES
$color-white: #fff;
$color-gray-100: #f8f9fa;
$color-gray-200: #e9ecef;
$color-gray-300: #dee2e6;
$color-gray-400: #ced4da;
$color-gray-500: #999;
$color-gray-600: #7A8288;
$color-gray-700: #52575C;
$color-gray-800: #3A3F44;
$color-gray-900: #272B30;
$color-black: #000;
$sidebar_opacity: 0.9;
#mixin flex-vCenter($justify-content:center) {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: $justify-content;
}
////////////////// Animation //////////////////
#keyframes move_up {
from {
transform: translateY(4rem);
}
to {
transform: translateY(-4rem);
}
}
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
// This defines what 1rem is
font-size: 62.5%; //1 rem = 10px; 10px/16px = 62.5%
box-sizing: border-box;
}
body {
font-weight: 400;
line-height: 1.6;
background-color: $color-gray-300;
}
.wrapper{
position: relative;
height: 30rem;
width: 30rem;
top:1rem;
left:10rem;
background-color: $color-gray-600;
}
.scroll_top__btn {
display: block;
text-align: center;
position: absolute;
bottom: 3rem;
right: 3rem;
&,
&:link,
&:visited {
#include flex-vCenter;
cursor: pointer;
opacity: $sidebar_opacity - .5;
background-color: $color-gray-200;
height: 4.5rem;
width: 4.5rem;
display: block;
border-radius: 5px;
transition: all .2s;
border: none;
overflow:hidden;
}
&:hover {
transform: translateY(-5px);
opacity: $sidebar_opacity;
}
&:active,
&:focus {
outline: none;
transform: translateY(-1px);
}
&-icon{
transform: translateY(0.8rem);
height: 2.5rem;
width: 2.5rem;
fill: $color-black;
filter: drop-shadow( 0 5px 2px rgba($color-black, .5));
}
&:hover &-icon{
animation: move_up .5s linear infinite;
}
}
#keyframes move_up {
from {
transform: translateY(4rem);
}
to {
transform: translateY(-4rem);
}
}
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
font-size: 62.5%;
box-sizing: border-box;
}
body {
font-weight: 400;
line-height: 1.6;
background-color: #dee2e6;
}
.wrapper {
position: relative;
height: 30rem;
width: 30rem;
top: 1rem;
left: 10rem;
background-color: #7A8288;
}
.scroll_top__btn {
display: block;
text-align: center;
position: absolute;
bottom: 3rem;
right: 3rem;
}
.scroll_top__btn, .scroll_top__btn:link, .scroll_top__btn:visited {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0.4;
background-color: #e9ecef;
height: 4.5rem;
width: 4.5rem;
display: block;
border-radius: 5px;
transition: all .2s;
border: none;
overflow: hidden;
}
.scroll_top__btn:hover {
transform: translateY(-5px);
opacity: 0.9;
}
.scroll_top__btn:active, .scroll_top__btn:focus {
outline: none;
transform: translateY(-1px);
}
.scroll_top__btn-icon {
transform: translateY(0.8rem);
height: 2.5rem;
width: 2.5rem;
fill: #000;
filter: drop-shadow(0 5px 2px rgba(0, 0, 0, 0.5));
}
.scroll_top__btn:hover .scroll_top__btn-icon {
animation: move_up .5s linear infinite;
}
<svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-arrow-up" viewBox="0 0 32 32">
<title>arrow-up</title>
<path d="M16 1l-15 15h9v16h12v-16h9z"></path>
</symbol>
</defs>
</svg>
<div class="wrapper">
<a href="javascript:void;" class="scroll_top__btn" type="button">
<svg class="scroll_top__btn-icon">
<use xlink:href="#icon-arrow-up" />
</svg>
</a>
</div>