gradient color to input field - html

just a relative simple question I think but can't find what to change. I you click to this input field you get a gradient color on the bottom of the field. I need to add something to get a red gradient color to the bottom when the page is loaded (so not clicked), when there is clicked the gradient changes to that yellow to pink gradient. thanks in advance!
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
body, html {
height: 100%;
font-family: Poppins-Regular, sans-serif;
}
/*---------------------------------------------*/
a {
font-family: Poppins-Regular;
font-size: 14px;
line-height: 1.7;
color: #666666;
margin: 0px;
transition: all 0.4s;
-webkit-transition: all 0.4s;
-o-transition: all 0.4s;
-moz-transition: all 0.4s;
}
a:focus {
outline: none !important;
}
a:hover {
text-decoration: none;
color: #6a7dfe;
color: -webkit-linear-gradient(left, #21d4fd, #b721ff);
color: -o-linear-gradient(left, #21d4fd, #b721ff);
color: -moz-linear-gradient(left, #21d4fd, #b721ff);
color: linear-gradient(left, #21d4fd, #b721ff);
}
/*---------------------------------------------*/
h1,h2,h3,h4,h5,h6 {
margin: 0px;
}
p {
font-family: Poppins-Regular;
font-size: 14px;
line-height: 1.7;
color: #666666;
margin: 0px;
}
ul, li {
margin: 0px;
list-style-type: none;
}
/*---------------------------------------------*/
input {
outline: none;
border: none;
}
textarea {
outline: none;
border: none;
}
textarea:focus, input:focus {
border-color: transparent !important;
}
/*------------------------------------------------------------------
[ Input ]*/
.wrap-input100 {
width: 100%;
position: relative;
border-bottom: 2px solid #adadad;
margin-bottom: 37px;
}
.input100 {
font-family: Poppins-Regular;
font-size: 15px;
color: #555555;
line-height: 1.2;
display: block;
width: 100%;
height: 45px;
background: transparent;
padding: 0 5px;
}
/*---------------------------------------------*/
.focus-input100 {
position: absolute;
display: block;
width: 100%;
height: 100%;
top: 0;
left: 0;
pointer-events: none;
}
.focus-input100::before {
content: "";
display: block;
position: absolute;
bottom: -2px;
left: 0;
width: 0;
height: 2px;
-webkit-transition: all 0.4s;
-o-transition: all 0.4s;
-moz-transition: all 0.4s;
transition: all 0.4s;
background: #6a7dfe;
background: -webkit-linear-gradient(left, yellow, #b721ff);
background: -o-linear-gradient(left, yellow, #b721ff);
background: -moz-linear-gradient(left, yellow, #b721ff);
background: linear-gradient(left, yellow, #b721ff);
}
.focus-input100::after {
font-family: Poppins-Regular;
font-size: 15px;
color: #999999;
line-height: 1.2;
content: attr(data-placeholder);
display: block;
width: 100%;
position: absolute;
top: 16px;
left: 0px;
padding-left: 5px;
-webkit-transition: all 0.4s;
-o-transition: all 0.4s;
-moz-transition: all 0.4s;
transition: all 0.4s;
}
.input100:focus + .focus-input100::after {
top: -15px;
}
.input100:focus + .focus-input100::before {
width: 100%;
}
.has-val.input100 + .focus-input100::after {
top: -15px;
}
.has-val.input100 + .focus-input100::before {
width: 100%;
}
/*------------------------------------------------------------------
[ Responsive ]*/
#media (max-width: 576px) {
.wrap-login100 {
padding: 77px 15px 33px 15px;
}
}
/*------------------------------------------------------------------
[ Alert validate ]*/
.validate-input {
position: relative;
}
.alert-validate::before {
content: attr(data-validate);
position: absolute;
max-width: 70%;
background-color: #fff;
border: 1px solid #c80000;
border-radius: 2px;
padding: 4px 25px 4px 10px;
top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
right: 0px;
pointer-events: none;
font-family: Poppins-Regular;
color: #c80000;
font-size: 13px;
line-height: 1.4;
text-align: left;
visibility: hidden;
opacity: 0;
-webkit-transition: opacity 0.4s;
-o-transition: opacity 0.4s;
-moz-transition: opacity 0.4s;
transition: opacity 0.4s;
}
.alert-validate::after {
content: "\f06a";
font-family: FontAwesome;
font-size: 16px;
color: #c80000;
display: block;
position: absolute;
background-color: #fff;
top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
right: 5px;
}
.alert-validate:hover:before {
visibility: visible;
opacity: 1;
}
.limiter {
width: 20%;
padding-top: 5%;
}
<div class="limiter">
<div class="wrap-input100 validate-input">
<span class="btn-show-pass">
<i class="zmdi zmdi-eye"></i>
</span>
<input class="input100" type="password" name="password">
<span class="focus-input100" data-placeholder="wachtwoord"></span>
</div>
</div>

Add CSS border-image and border-image-slice properties to the .wrap-input100 class
.wrap-input100 {
width: 100%;
position: relative;
margin-bottom: 37px;
border-bottom: 2px solid transparent;
border-image: linear-gradient(to right, #b721ff 0%, red 100%);
border-image-slice: 1;
}

Related

Scrolling issues on Mobile

I need help with my contact form, the screen isn't in fixed position and some element is making the page being able to scroll on mobile when its not supposed to since everything is aligned in the center. I tried removing padding in container in the Mobile query but that did not work and I can't seem to find out why its scrolling, I changed the viewport to 100% width and that fixed the issue but that will not work in the long run since my website is supposed to be responsive and I changed the viewport back to initial scale and everything as seen in the HTML code but the scrolling issue comes back.
CSS and HTML
#media screen and (max-width: 500px) /* Mobile */ {
* {
box-sizing: border-box;
}
#navigation {
display: none;
}
input[type=text3], select, textarea {
width: 55%; /* Full width */
padding: 30px; /* Some padding */
margin-top: 0px;
outline: none;
color: #ff0055;
text-align: center;
border: 1px solid #f3f3f3; /* Gray border */
border-radius: 100px; /* Rounded borders */
}
input[type=text2], select, textarea {
width: 55%; /* Full width */
padding: 20px; /* Some padding */
color: #ff0055;
outline: none;
text-align: center;
border: 1px solid #f3f3f3; /* Gray border */
border-radius: 100px; /* Rounded borders */
}
input[type=text2]:hover, select, textarea {
width: 55%; /* Full width */
padding: 20px; /* Some padding */
color: #ff0055;
text-align: center;
border: 2px solid #ff0055; /* Gray border */
border-radius: 100px; /* Rounded borders */
transition: all 0.3s ease 0s;
}
input[type=text3]:hover, select, textarea {
width: 55%; /* Full width */
padding: 30px; /* Some padding */
margin-top: 0px;
color: #ff0055;
text-align: center;
border: 2px solid #ff0055; /* Gray border */
border-radius: 100px; /* Rounded borders */
transition: all 0.3s ease 0s;
}
input[type=text], select, textarea {
width: 55%; /* Full width */
padding: 20px; /* Some padding */
text-align: center;
outline: none;
color: #FF0055;
border: 1px solid #f3f3f3; /* Gray border */
border-radius: 100px; /* Rounded borders */
}
input[type=text]:hover, select, textarea {
width: 55%;
padding: 20px; /* Some padding */
text-align: center;
border: 2px solid #ff0055; /* Gray border */
border-radius: 50px; /* Rounded borders */
transition: all 0.3s ease 0s;
}
input[type=submit] {
background-color: #001FFF;
color: white;
font-size: 16px;
font-family: 'Open Sans', sans-serif;
border: none;
cursor: pointer;
border-color: #000000;
text-align: center;
display: inline-block;
text-decoration: none;
text-shadow: none;
margin: 50px 175px;
padding: 10px 50px;
border: none;
border-radius: 100px;
outline: none;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #0019CF;
color: white;
text-align: center;
outline: none;
-ms-transform: translate(-50%, -50%);
transition: all 0.3s ease 0s;
-webkit-box-shadow: 0px 20px 15px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0px 20px 15px rgba(0, 0, 0, 0.1);
box-shadow: 0px 20px 15px rgba(0, 0, 0, 0.1);
}
.container {
border-radius: 100%;
font-size: 20px;
text-align: center;
background-color: #FFFFFF;
display: inline-block;
}
.nav2 {
height: 50px;
width: 100%;
margin: 0 auto;
background-color: white;
position: fixed;
z-index: 9999;
}
.nav2 > .nav-header {
display: inline;
margin: 0 auto;
z-index: 9999;
}
.nav2 > .nav-header > .nav-title {
display: inline-block;
font-size: 20px;
margin: 0 auto;
color: #fff;
font-family: 'Pacifico', cursive;
padding: 5px 10px 10px 15px;
}
#header {
display: inline-block;
font-size: 20px;
position: fixed;
margin: 0 auto;
color: #000;
z-index: 10000;
font-family: 'Pacifico', cursive;
padding: 5px 10px 10px 15px;
}
.nav2 > .nav-btn {
display: none;
margin: 0 auto;
}
.nav2 > .nav-links {
display: inline;
z-index: 9999;
margin: 0 auto;
float: right;
font-size: 15px;
}
.nav2 > .nav-links > a {
display: inline-block;
z-index: 9999;
margin: 0 auto;
text-align: center;
background-color: white;
padding: 13px 10px 13px 10px;
text-decoration: none;
color: #000;
}
.nav2 > .nav-links > a:hover {
background-color: #005DFF;
color: white;
z-index: 9999;
}
.nav2 > #nav-check {
display: none;
}
#media (max-width:600px) {
.nav2 > .nav-btn {
z-index: 9999;
display: inline-block;
position: absolute;
right: 0px;
top: 0px;
}
.nav2 > .nav-btn > label {
display: inline-block;
z-index: 9999;
background-color: white;
color: black;
width: 50px;
height: 50px;
padding: 13px;
}
.nav2 > .nav-btn > label:hover {
background-color: blue);
z-index: 9999;
}
.nav2 > .nav-btn > label > span {
display: block;
z-index: 9999;
width: 25px;
height: 10px;
border-top: 3px solid black;
}
.nav2 > .nav-links {
position: absolute;
display: block;
width: 100%;
background-color: #fff;
height: 0px;
z-index: 9999;
transition: all 0.3s ease-in;
overflow-y: hidden;
top: 50px;
left: 0px;
}
.nav2 > .nav-links > a {
display: block;
z-index: 9999;
color: black;
width: 100%;
}
.nav2> #nav-check:not(:checked) + .nav-links {
height: 0px;
z-index: 9999;
}
.nav2 > #nav-check:checked + .nav-links {
height: calc(100vh - 50px);
z-index: 9999;
overflow-y: auto;
}
}
}
.button {
position: absolute;
top: 130%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transition: all 0.3s ease 0s;
-webkit-box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
background-color: #FFFFFF;
color: black;
font-size: 16px;
padding: 32px 24px;
font-family: 'Open Sans', sans-serif;
border: none;
cursor: pointer;
border-radius: 100px;
border-color: #000000;
text-align: center;
display: flex;
text-decoration: none;
text-shadow: none;
align-items: center;
justify-content: center;
}
.button:hover {
background-color: #FFFFFF;
box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.3);
color: #FF0055;
text-shadow: none;
text-decoration: none;
}
#keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Firefox < 16 */
#-moz-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Safari, Chrome and Opera > 12.1 */
#-webkit-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Internet Explorer */
#-ms-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Opera < 12.1 */
#-o-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
body, html {
height: 100%;
margin: 0;
font-family: 'Overpass', sans-serif;
background: #ffffff;
}
p {
text-align: center;
}
h1 {
text-align: center;
padding: 100px;
font-weight: bolder;
}
h2 {
padding: 10px 10px;
font-weight: bolder;
}
h3 {
font-weight: bolder;
top: 50%;
left: -10%;
transform: translate(0%, -100%);
}
#header.active {
box-shadow: 0 0 5px rgba(0,0,0,0.3);
-webkit-animation: fadein 1s; /* Safari, Chrome and Opera > 12.1 */
-moz-animation: fadein 1s; /* Firefox < 16 */
-ms-animation: fadein 1s; /* Internet Explorer */
-o-animation: fadein 1s; /* Opera < 12.1 */
animation: fadein 1s;
}
a:link {
position: relative;
color: #000000;
text-decoration: none;
}
a:hover {
color: #000000;
}
a:link:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: #000000;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.nav:hover:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.active:hover:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
a:link {
cursor: pointer;
padding: 13px;
text-decoration: none;
}
a:link:hover {
padding: 13px;
-webkit-transition: height 0.5s ease;
-moz-transition: height 0.5s ease;
-o-transition: height 0.5s ease;
-ms-transition: height 0.5s ease;
transition: background-color 0.5s ease;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-o-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
a:link:active {
padding: 13px;
-webkit-transition: height 0.5s ease;
-moz-transition: height 0.5s ease;
-o-transition: height 0.5s ease;
-ms-transition: height 0.5s ease;
transition: background-color 0.5s ease;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-o-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
a:visited {
color: #000000;
}
#header.scroll {
background-color: #000000;
opacity: 0.5;
}
.main {
border-radius: 100px;
padding: 13px;
border: none!important;
text-decoration: none!important
}
.main:hover {
background-color: #00439F;
color: white;
border: none;
padding: 13px;
text-decoration: none!important;
box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.2);
position: fixed;
margin: -13px -90px;
border-radius: 100px;
-webkit-animation:bounce 1s infinite;
}
</style>
<!doctype html>
<html>
<head>
<link href="https://cdn.rawgit.com/michalsnik/aos/2.1.1/dist/aos.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>adamferreira - Contact</title>
<script src="https://cdn.rawgit.com/michalsnik/aos/2.1.1/dist/aos.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="header">adamferreira</div>
<div id="navigation"
<ul>
<a class="main" href="portfolio.html">Portfolio</a>
<a class="nav" href="index.html">Home</a>
<a class="nav" href="contact.php">Contact</a>
<a class="nav" href="featured.html">Featured</a>
<a class="nav" href="story-highlights.html">Story Highlights</a>
</ul>
</div>
</div>
</div>
<div class="nav2">
<div class="nav-header">
<div class="nav-title"></div>
</div>
<div class="nav-btn">
<label for="nav-check">
<span></span>
<span></span>
<span></span>
</label>
</div>
<input type="checkbox" id="nav-check">
<div class="nav-links">
Portfolio
Home
Contact
Featured
Story Highlights
</div>
</div>
</head>
<body>
<div class="headerBackground"></div>
<div class="container" data-aos="ease-in-out-back" data-aos="zoom out">
<h1>Contact</h1>
<form method="POST">
<input type="text" name="firstname" placeholder="Your name..." style="font-size: 15px;">
<input type="text2" name="lastname" placeholder="Your last name..." style="font-size: 15px;">
<input type="text3" name="comment" placeholder="Type your comment..." style="font-size: 15px;">
<input type="submit" class="btn" name="submit" value="Submit">
</form>
</div>
</body>
</html>
Your submit button is absolutely massive due to the margin: 50px 175px;. Just the margins take up 350px. Factor in the actual width of the button (50px) and you have 400px right there.
If you set a viewport tag (width=device-width), you're looking at 375px (or so) for an iPhone 6/7/8. So, excluding any other margin/padding to the body, you're already overflowing.
Edit:
Rather than use a defined value to center/offset the button, you could change display from inline-block to block. Then margin: 50px 175px to margin: 50px auto; which will center. flexbox would also help, but requires a bit more changes to the container/children.
Here's the rendered HTML/CSS after adjusting submit to display: block; margin: 50px auto (no more horizontal scroll!):
#media screen and (max-width: 500px)
/* Mobile */
{
* {
box-sizing: border-box;
}
#navigation {
display: none;
}
input[type=text3], select, textarea {
width: 55%;
/* Full width */
padding: 30px;
/* Some padding */
margin-top: 0px;
outline: none;
color: #ff0055;
text-align: center;
border: 1px solid #f3f3f3;
/* Gray border */
border-radius: 100px;
/* Rounded borders */
}
input[type=text2], select, textarea {
width: 55%;
/* Full width */
padding: 20px;
/* Some padding */
color: #ff0055;
outline: none;
text-align: center;
border: 1px solid #f3f3f3;
/* Gray border */
border-radius: 100px;
/* Rounded borders */
}
input[type=text2]:hover, select, textarea {
width: 55%;
/* Full width */
padding: 20px;
/* Some padding */
color: #ff0055;
text-align: center;
border: 2px solid #ff0055;
/* Gray border */
border-radius: 100px;
/* Rounded borders */
transition: all 0.3s ease 0s;
}
input[type=text3]:hover, select, textarea {
width: 55%;
/* Full width */
padding: 30px;
/* Some padding */
margin-top: 0px;
color: #ff0055;
text-align: center;
border: 2px solid #ff0055;
/* Gray border */
border-radius: 100px;
/* Rounded borders */
transition: all 0.3s ease 0s;
}
input[type=text], select, textarea {
width: 55%;
/* Full width */
padding: 20px;
/* Some padding */
text-align: center;
outline: none;
color: #FF0055;
border: 1px solid #f3f3f3;
/* Gray border */
border-radius: 100px;
/* Rounded borders */
}
input[type=text]:hover, select, textarea {
width: 55%;
padding: 20px;
/* Some padding */
text-align: center;
border: 2px solid #ff0055;
/* Gray border */
border-radius: 50px;
/* Rounded borders */
transition: all 0.3s ease 0s;
}
input[type=submit] {
background-color: #001FFF;
color: white;
font-size: 16px;
font-family: 'Open Sans', sans-serif;
border: none;
cursor: pointer;
border-color: #000000;
text-align: center;
display: block;
text-decoration: none;
text-shadow: none;
margin: 50px auto;
padding: 10px 50px;
border: none;
border-radius: 100px;
outline: none;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #0019CF;
color: white;
text-align: center;
outline: none;
-ms-transform: translate(-50%, -50%);
transition: all 0.3s ease 0s;
-webkit-box-shadow: 0px 20px 15px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0px 20px 15px rgba(0, 0, 0, 0.1);
box-shadow: 0px 20px 15px rgba(0, 0, 0, 0.1);
}
.container {
border-radius: 100%;
font-size: 20px;
text-align: center;
background-color: #FFFFFF;
display: inline-block;
}
.nav2 {
height: 50px;
width: 100%;
margin: 0 auto;
background-color: white;
position: fixed;
z-index: 9999;
}
.nav2 > .nav-header {
display: inline;
margin: 0 auto;
z-index: 9999;
}
.nav2 > .nav-header > .nav-title {
display: inline-block;
font-size: 20px;
margin: 0 auto;
color: #fff;
font-family: 'Pacifico', cursive;
padding: 5px 10px 10px 15px;
}
#header {
display: inline-block;
font-size: 20px;
position: fixed;
margin: 0 auto;
color: #000;
z-index: 10000;
font-family: 'Pacifico', cursive;
padding: 5px 10px 10px 15px;
}
.nav2 > .nav-btn {
display: none;
margin: 0 auto;
}
.nav2 > .nav-links {
display: inline;
z-index: 9999;
margin: 0 auto;
float: right;
font-size: 15px;
}
.nav2 > .nav-links > a {
display: inline-block;
z-index: 9999;
margin: 0 auto;
text-align: center;
background-color: white;
padding: 13px 10px 13px 10px;
text-decoration: none;
color: #000;
}
.nav2 > .nav-links > a:hover {
background-color: #005DFF;
color: white;
z-index: 9999;
}
.nav2 > #nav-check {
display: none;
}
#media (max-width:600px) {
.nav2 > .nav-btn {
z-index: 9999;
display: inline-block;
position: absolute;
right: 0px;
top: 0px;
}
.nav2 > .nav-btn > label {
display: inline-block;
z-index: 9999;
background-color: white;
color: black;
width: 50px;
height: 50px;
padding: 13px;
}
.nav2 > .nav-btn > label:hover {
background-color: blue);
z-index: 9999;
}
.nav2 > .nav-btn > label > span {
display: block;
z-index: 9999;
width: 25px;
height: 10px;
border-top: 3px solid black;
}
.nav2 > .nav-links {
position: absolute;
display: block;
width: 100%;
background-color: #fff;
height: 0px;
z-index: 9999;
transition: all 0.3s ease-in;
overflow-y: hidden;
top: 50px;
left: 0px;
}
.nav2 > .nav-links > a {
display: block;
z-index: 9999;
color: black;
width: 100%;
}
.nav2> #nav-check:not(:checked) + .nav-links {
height: 0px;
z-index: 9999;
}
.nav2 > #nav-check:checked + .nav-links {
height: calc(100vh - 50px);
z-index: 9999;
overflow-y: auto;
}
}
}
.button {
position: absolute;
top: 130%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transition: all 0.3s ease 0s;
-webkit-box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
background-color: #FFFFFF;
color: black;
font-size: 16px;
padding: 32px 24px;
font-family: 'Open Sans', sans-serif;
border: none;
cursor: pointer;
border-radius: 100px;
border-color: #000000;
text-align: center;
display: flex;
text-decoration: none;
text-shadow: none;
align-items: center;
justify-content: center;
}
.button:hover {
background-color: #FFFFFF;
box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.3);
color: #FF0055;
text-shadow: none;
text-decoration: none;
}
#keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Firefox < 16 */
#-moz-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Safari, Chrome and Opera > 12.1 */
#-webkit-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Internet Explorer */
#-ms-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Opera < 12.1 */
#-o-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
body, html {
height: 100%;
margin: 0;
font-family: 'Overpass', sans-serif;
background: #ffffff;
}
p {
text-align: center;
}
h1 {
text-align: center;
padding: 100px;
font-weight: bolder;
}
h2 {
padding: 10px 10px;
font-weight: bolder;
}
h3 {
font-weight: bolder;
top: 50%;
left: -10%;
transform: translate(0%, -100%);
}
#header.active {
box-shadow: 0 0 5px rgba(0,0,0,0.3);
-webkit-animation: fadein 1s;
/* Safari, Chrome and Opera > 12.1 */
-moz-animation: fadein 1s;
/* Firefox < 16 */
-ms-animation: fadein 1s;
/* Internet Explorer */
-o-animation: fadein 1s;
/* Opera < 12.1 */
animation: fadein 1s;
}
a:link {
position: relative;
color: #000000;
text-decoration: none;
}
a:hover {
color: #000000;
}
a:link:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: #000000;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.nav:hover:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.active:hover:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
a:link {
cursor: pointer;
padding: 13px;
text-decoration: none;
}
a:link:hover {
padding: 13px;
-webkit-transition: height 0.5s ease;
-moz-transition: height 0.5s ease;
-o-transition: height 0.5s ease;
-ms-transition: height 0.5s ease;
transition: background-color 0.5s ease;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-o-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
a:link:active {
padding: 13px;
-webkit-transition: height 0.5s ease;
-moz-transition: height 0.5s ease;
-o-transition: height 0.5s ease;
-ms-transition: height 0.5s ease;
transition: background-color 0.5s ease;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-o-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
a:visited {
color: #000000;
}
#header.scroll {
background-color: #000000;
opacity: 0.5;
}
.main {
border-radius: 100px;
padding: 13px;
border: none!important;
text-decoration: none!important
}
.main:hover {
background-color: #00439F;
color: white;
border: none;
padding: 13px;
text-decoration: none!important;
box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.2);
position: fixed;
margin: -13px -90px;
border-radius: 100px;
-webkit-animation:bounce 1s infinite;
}
<!doctype html>
<html>
<head>
<link href="https://cdn.rawgit.com/michalsnik/aos/2.1.1/dist/aos.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>adamferreira - Contact</title>
<script src="https://cdn.rawgit.com/michalsnik/aos/2.1.1/dist/aos.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="header">adamferreira</div>
<div id="navigation"
<ul>
<a class="main" href="portfolio.html">Portfolio</a>
<a class="nav" href="index.html">Home</a>
<a class="nav" href="contact.php">Contact</a>
<a class="nav" href="featured.html">Featured</a>
<a class="nav" href="story-highlights.html">Story Highlights</a>
</ul>
</div>
</div>
</div>
<div class="nav2">
<div class="nav-header">
<div class="nav-title"></div>
</div>
<div class="nav-btn">
<label for="nav-check">
<span></span>
<span></span>
<span></span>
</label>
</div>
<input type="checkbox" id="nav-check">
<div class="nav-links">
Portfolio
Home
Contact
Featured
Story Highlights
</div>
</div>
</head>
<body>
<div class="headerBackground"></div>
<div class="container" data-aos="ease-in-out-back" data-aos="zoom out">
<h1>Contact</h1>
<form method="POST">
<input type="text" name="firstname" placeholder="Your name..." style="font-size: 15px;">
<input type="text2" name="lastname" placeholder="Your last name..." style="font-size: 15px;">
<input type="text3" name="comment" placeholder="Type your comment..." style="font-size: 15px;">
<input type="submit" class="btn" name="submit" value="Submit">
</form>
</div>
</body>
</html>

CSS - How to prevent opening both left and right sidebar?

I am a beginner of HTML and CSS. I am learning web development recently and trying to make a simple website page. On that page, there will be two sidebars. One is left side bar, other one is right side bar. But when i click on left sidebar menu icon, it opens both left and right sidebar, but i want to open only left one. And when i click on right sidebar menu icon, it only opens right sidebar. What am i doing wrong here ?
html,
body {
overflow-x: hidden;
height: 100%;
}
body {
background: white;
padding: 0;
margin: 0;
font-family: tahoma;
}
body {
background-image: url(scene.jpg);
background-size: cover;
background-position: center;
}
.header {
display: block;
margin: 0 auto;
width: 100%;
max-width: 100%;
box-shadow: none;
background-color: #000000;
position: fixed;
height: 60px !important;
overflow: hidden;
z-index: 10;
}
.main {
margin: 0 auto;
display: block;
height: 100%;
margin-top: 60px;
}
.mainInner {
display: table;
height: 100%;
width: 100%;
text-align: center;
}
.sidebarMenu {
height: 100%;
position: fixed;
left: 0;
width: 250px;
margin-top: 60px;
transform: translateX(-250px);
transition: transform 250ms ease-in-out;
background: linear-gradient(180deg, #000000 0%, #3f5efb 100%);
}
.rightsidebarMenu {
height: 100%;
position: fixed;
right: 0;
width: 250px;
margin-top: 60px;
transform: translateX(250px);
transition: transform 250ms ease-in-out;
background: linear-gradient(180deg, #000000 0%, #3f5efb 100%);
}
.sidebarMenuInner {
margin: 0;
padding: 0;
border-top: 1px solid rgba (255, 255, 255, 0.10);
}
.rightsidebarMenuInner {
margin: 0;
padding: 0;
border-top: 1px solid rgba (255, 255, 255, 0.10);
}
.sidebarMenuInner li {
list-style: none;
color: white;
text-transform: uppercase;
font-weight: bold;
padding: 20px;
cursor: pointer;
border-bottom: 1px solid rgba (255, 255, 255, 0.10);
}
.rightsidebarMenuInner li {
list-style: none;
color: white;
text-transform: uppercase;
font-weight: bold;
padding: 20px;
cursor: pointer;
border-bottom: 1px solid rgba (255, 255, 255, 0.10);
}
.sidebarMenuInner li a {
text-transform: uppercase;
font-weight: bold;
cursor: pointer;
text-decoration: none;
color: white;
border: 2px;
}
.rightsidebarMenuInner li a {
text-transform: uppercase;
font-weight: bold;
cursor: pointer;
text-decoration: none;
color: white;
border: 2px;
}
.sidebarMenuInner li span {
display: block;
font-size: 14px;
color: rgba (255, 255, 255, 0.50);
}
.rightsidebarMenuInner li span {
display: block;
font-size: 14px;
color: rgba (255, 255, 255, 0.50);
}
input[type="checkbox"] {
transition: all 0.3s;
box-sizing: border-box;
display: none;
}
input[type="checkbox"] {
transition: all 0.3s;
box-sizing: border-box;
display: none;
}
input[type="checkbox"]:checked~.sidebarMenu {
transform: translateX(0);
}
input[type="checkbox"]:checked~.rightsidebarMenu {
transform: translateX(0);
}
.sidebarIconToggle {
transition: all 0.3s;
box-sizing: border-box;
cursor: pointer;
position: absolute;
z-index: 99;
height: 100%;
width: 100%;
top: 22px;
left: 35px;
height: 22px;
width: 22px;
}
.rightsidebarIconToggle {
transition: all 0.3s;
box-sizing: border-box;
cursor: pointer;
position: absolute;
z-index: 99;
height: 100%;
width: 100%;
top: 22px;
right: 35px;
height: 22px;
width: 22px;
}
.spinner {
transition: all 0.3s;
box-sizing: border-box;
position: absolute;
height: 3px;
width: 100%;
background-color: white;
}
.right.spinner {
transition: all 0.3s;
box-sizing: border-box;
position: absolute;
height: 3px;
width: 100%;
background-color: white;
}
.horizontal {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: left;
margin-top: 3px;
}
.right.horizontal {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: right;
margin-top: 3px;
}
.diagonal.part-1 {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: left;
}
.right.diagonal.part-1 {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: right;
}
.diagonal.part-2 {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: left;
margin-top: 3px;
}
.right.diagonal.part-2 {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: right;
margin-top: 3px;
}
input[type="checkbox"]:checked~.sidebarIconToggle>.horizontal {
transition: all 0.3s;
box-sizing: border-box;
opacity: 0;
}
input[type="checkbox"]:checked~.sidebarIconToggle>.diagonal.part-1 {
transition: all 0.3s;
box-sizing: border-box;
transform: rotate(135deg);
margin-top: 8px;
}
input[type="checkbox"]:checked~.sidebarIconToggle>.diagonal.part-2 {
transition: all 0.3s;
box-sizing: border-box;
transform: rotate(-135deg);
margin-top: -8px;
}
input[type="checkbox"]:checked~.rightsidebarIconToggle>.right.horizontal {
transition: all 0.3s;
box-sizing: border-box;
opacity: 0;
}
input[type="checkbox"]:checked~.rightsidebarIconToggle>.right.diagonal.part-1 {
transition: all 0.3s;
box-sizing: border-box;
transform: rotate(135deg);
margin-top: 8px;
}
input[type="checkbox"]:checked~.rightsidebarIconToggle>.right.diagonal.part-2 {
transition: all 0.3s;
box-sizing: border-box;
transform: rotate(-135deg);
margin-top: -8px;
}
<div class="header"></div>
<input type="checkbox" class="openSidebarMenu" id="openSidebarMenu">
<label for="openSidebarMenu" class="sidebarIconToggle">
<div class="spinner diagonal part-1"></div>
<div class="spinner horizontal"></div>
<div class="spinner diagonal part-2"></div>
</label>
<div class="sidebarMenu">
<ul class="sidebarMenuInner">
<li>Munem Sohan <span>Web Developer</span></li>
<li><span>Company</span></li>
<li><span>Facebook</span></li>
<li><span>Twitter</span></li>
</ul>
</div>
<input type="checkbox" class="rightopenSidebarMenu" id="rightopenSidebarMenu">
<label for="rightopenSidebarMenu" class="rightsidebarIconToggle">
<div class="right spinner diagonal part-1"></div>
<div class="right spinner horizontal"></div>
<div class="right spinner diagonal part-2"></div>
</label>
<div class="rightsidebarMenu">
<ul class="rightsidebarMenuInner">
<li>Sohan <span>Web Developer</span></li>
<li><span>Sabbir</span></li>
<li><span>Sumi</span></li>
<li><span>Shovon</span></li>
</ul>
</div>
You need to add id with checkbox, so it can apply checkbox uniquely for opening toggle
html,
body {
overflow-x: hidden;
height: 100%;
}
body {
background: white;
padding: 0;
margin: 0;
font-family: tahoma;
}
body {
background-image: url(scene.jpg);
background-size: cover;
background-position: center;
}
.header {
display: block;
margin: 0 auto;
width: 100%;
max-width: 100%;
box-shadow: none;
background-color: #000000;
position: fixed;
height: 60px !important;
overflow: hidden;
z-index: 10;
}
.main {
margin: 0 auto;
display: block;
height: 100%;
margin-top: 60px;
}
.mainInner {
display: table;
height: 100%;
width: 100%;
text-align: center;
}
.sidebarMenu {
height: 100%;
position: fixed;
left: 0;
width: 250px;
margin-top: 60px;
transform: translateX(-250px);
transition: transform 250ms ease-in-out;
background: linear-gradient(180deg, #000000 0%, #3f5efb 100%);
}
.rightsidebarMenu {
height: 100%;
position: fixed;
right: 0;
width: 250px;
margin-top: 60px;
transform: translateX(250px);
transition: transform 250ms ease-in-out;
background: linear-gradient(180deg, #000000 0%, #3f5efb 100%);
}
.sidebarMenuInner {
margin: 0;
padding: 0;
border-top: 1px solid rgba (255, 255, 255, 0.10);
}
.rightsidebarMenuInner {
margin: 0;
padding: 0;
border-top: 1px solid rgba (255, 255, 255, 0.10);
}
.sidebarMenuInner li {
list-style: none;
color: white;
text-transform: uppercase;
font-weight: bold;
padding: 20px;
cursor: pointer;
border-bottom: 1px solid rgba (255, 255, 255, 0.10);
}
.rightsidebarMenuInner li {
list-style: none;
color: white;
text-transform: uppercase;
font-weight: bold;
padding: 20px;
cursor: pointer;
border-bottom: 1px solid rgba (255, 255, 255, 0.10);
}
.sidebarMenuInner li a {
text-transform: uppercase;
font-weight: bold;
cursor: pointer;
text-decoration: none;
color: white;
border: 2px;
}
.rightsidebarMenuInner li a {
text-transform: uppercase;
font-weight: bold;
cursor: pointer;
text-decoration: none;
color: white;
border: 2px;
}
.sidebarMenuInner li span {
display: block;
font-size: 14px;
color: rgba (255, 255, 255, 0.50);
}
.rightsidebarMenuInner li span {
display: block;
font-size: 14px;
color: rgba (255, 255, 255, 0.50);
}
input[type="checkbox"] {
transition: all 0.3s;
box-sizing: border-box;
display: none;
}
input[type="checkbox"] {
transition: all 0.3s;
box-sizing: border-box;
display: none;
}
input[type="checkbox"]#openSidebarMenu:checked~.sidebarMenu {
transform: translateX(0);
}
input[type="checkbox"]#rightopenSidebarMenu:checked~.rightsidebarMenu {
transform: translateX(0);
}
.sidebarIconToggle {
transition: all 0.3s;
box-sizing: border-box;
cursor: pointer;
position: absolute;
z-index: 99;
height: 100%;
width: 100%;
top: 22px;
left: 35px;
height: 22px;
width: 22px;
}
.rightsidebarIconToggle {
transition: all 0.3s;
box-sizing: border-box;
cursor: pointer;
position: absolute;
z-index: 99;
height: 100%;
width: 100%;
top: 22px;
right: 35px;
height: 22px;
width: 22px;
}
.spinner {
transition: all 0.3s;
box-sizing: border-box;
position: absolute;
height: 3px;
width: 100%;
background-color: white;
}
.right.spinner {
transition: all 0.3s;
box-sizing: border-box;
position: absolute;
height: 3px;
width: 100%;
background-color: white;
}
.horizontal {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: left;
margin-top: 3px;
}
.right.horizontal {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: right;
margin-top: 3px;
}
.diagonal.part-1 {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: left;
}
.right.diagonal.part-1 {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: right;
}
.diagonal.part-2 {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: left;
margin-top: 3px;
}
.right.diagonal.part-2 {
transition: all 0.3s;
box-sizing: border-box;
position: relative;
float: right;
margin-top: 3px;
}
input[type="checkbox"]#openSidebarMenu:checked~.sidebarIconToggle>.horizontal {
transition: all 0.3s;
box-sizing: border-box;
opacity: 0;
}
input[type="checkbox"]#openSidebarMenu:checked~.sidebarIconToggle>.diagonal.part-1 {
transition: all 0.3s;
box-sizing: border-box;
transform: rotate(135deg);
margin-top: 8px;
}
input[type="checkbox"]#openSidebarMenu:checked~.sidebarIconToggle>.diagonal.part-2 {
transition: all 0.3s;
box-sizing: border-box;
transform: rotate(-135deg);
margin-top: -8px;
}
input[type="checkbox"]#rightopenSidebarMenu:checked~.rightsidebarIconToggle>.right.horizontal {
transition: all 0.3s;
box-sizing: border-box;
opacity: 0;
}
input[type="checkbox"]#rightopenSidebarMenu:checked~.rightsidebarIconToggle>.right.diagonal.part-1 {
transition: all 0.3s;
box-sizing: border-box;
transform: rotate(135deg);
margin-top: 8px;
}
input[type="checkbox"]#rightopenSidebarMenu:checked~.rightsidebarIconToggle>.right.diagonal.part-2 {
transition: all 0.3s;
box-sizing: border-box;
transform: rotate(-135deg);
margin-top: -8px;
}
<div class="header"></div>
<input type="checkbox" class="openSidebarMenu" id="openSidebarMenu">
<label for="openSidebarMenu" class="sidebarIconToggle">
<div class="spinner diagonal part-1"></div>
<div class="spinner horizontal"></div>
<div class="spinner diagonal part-2"></div>
</label>
<div class="sidebarMenu">
<ul class="sidebarMenuInner">
<li>Munem Sohan <span>Web Developer</span></li>
<li><span>Company</span></li>
<li><span>Facebook</span></li>
<li><span>Twitter</span></li>
</ul>
</div>
<input type="checkbox" class="rightopenSidebarMenu" id="rightopenSidebarMenu">
<label for="rightopenSidebarMenu" class="rightsidebarIconToggle">
<div class="right spinner diagonal part-1"></div>
<div class="right spinner horizontal"></div>
<div class="right spinner diagonal part-2"></div>
</label>
<div class="rightsidebarMenu">
<ul class="rightsidebarMenuInner">
<li>Sohan <span>Web Developer</span></li>
<li><span>Sabbir</span></li>
<li><span>Sumi</span></li>
<li><span>Shovon</span></li>
</ul>
</div>

Hover transition from bottom to top on button not working

I am trying to mimic the hover transitions for buttons as found on this page.
I have the following so far:
.hs-button {
font-size: 16px;
font-family: "Raleway", sans-serif;
text-transform: uppercase;
line-height: 1em;
color: #333333;
letter-spacing: 0;
background: #fff336;
display: inline-block;
position: relative;
cursor: pointer;
-webkit-transition: 0.3s;
transition: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
input[type="submit"]:hover {
text-decoration: none;
transform: translateY(0px);
-webkit-transform: translateY(0px);
}
input[type="submit"]:hover {
border: 3px solid #000;
background-color: #000;
color: #fff336;
}
input[type="submit"]:hover:after {
height: 100%;
}
input[type="submit"]:after {
content: "";
background: #000;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 0;
z-index: -1;
-webkit-transition: 0.3s;
transition: 0.3s;
}
<div class="hs_submit">
<div class="actions">
<input type="submit" value="DOWNLOAD NOW!" class="hs-button primary large">
</div>
</div>
The above button is the only button on my page and with the following above code, I'd expect it the black background to hover from bottom to top, but it's not - why?
Edit:
[Preview link to page][2]
You don't have to use pseudo-element with input tag (Can I use a :before or :after pseudo-element on an input field?). Consider adding pseudo element on a container. Also remove the background of your input. It need to be transparent so you can see the effect of pseudo-element behind.
Here is an example:
.actions {
display:inline-block;
position:relative;
}
.hs-button {
font-size: 16px;
font-family: "Raleway", sans-serif;
text-transform: uppercase;
line-height: 1em;
color: #333333;
letter-spacing: 0;
padding:20px;
border:none;
display: inline-block;
position: relative;
cursor: pointer;
z-index:1;
}
.actions:hover input[type="submit"] {
color: #fff336;
background:transparent;
}
.actions:before {
content: "";
background: #000;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 0;
z-index:0;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.actions:hover::before {
height:100%;
}
<div class="hs_submit">
<div class="actions">
<input type="submit" value="DOWNLOAD NOW!" class="hs-button primary large">
</div>
</div>
input not support ::before ::after you can use
<Button>
than add ::before ::after .
LIke https://jsfiddle.net/ufL55gfw/1/
Try below
.slider-button {
margin-top: 70px;
}
#media (max-width: 1220px) {
.slider-button {
margin-top: 30px;
}
}
.slider-button .button {
text-align: left;
}
#media (max-width: 1220px) {
.slider-button .button {
text-align: center;
}
}
.slider-button .button {
text-align: left;
}
.button {
text-align: center;
}
.button a{text-decoration:none;}
.button__item {
font-family: "Raleway", sans-serif;
font-weight: 500;
text-transform: uppercase;
font-size: 1.313rem;
line-height: 1em;
color: #333333;
letter-spacing: 0;
background: #fff336;
padding: 32.5px 65px;
display: inline-block;
position: relative;
cursor: pointer;
-webkit-transition: 0.3s;
transition: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.button__item:hover {
text-decoration: none;
-webkit-transform: translateY(0px);
transform: translateY(0px);
}
.button__item:hover:after {
height: 100%;
}
.button__item:after {
content: "";
background: #fff;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 0;
z-index: -1;
-webkit-transition: 0.3s;
transition: 0.3s;
}
<div class="slider-button"><div class="button">DOWNLOAD NOW</div></div>

CSS/Weebly: Changing site-title font

I'm trying to change my site-title font on weebly. But unfortunately, it won't work.
I've tried some youtube tutorials but they didn't help.
I would like to have this font as site-title. (https://www.onlinewebfonts.com/download/7ad138835c0cf9f05a9f0ab343247612)
Hereby my css code and a screenshot, so I hope you can help me :)
Thank you in advance!
Screenshot: http://i66.tinypic.com/znu1aa.png[/IMG
#import url(//fonts.googleapis.com/css?family=Fjalla+One);
#font-face {font-family: "PNS";
src: url("http://db.onlinewebfonts.com/t/7ad138835c0cf9f05a9f0ab343247612.eot");
src: url("http://db.onlinewebfonts.com/t/7ad138835c0cf9f05a9f0ab343247612.eot?#iefix") format("embedded-opentype"),
url("http://db.onlinewebfonts.com/t/7ad138835c0cf9f05a9f0ab343247612.woff2") format("woff2"),
url("http://db.onlinewebfonts.com/t/7ad138835c0cf9f05a9f0ab343247612.woff") format("woff"),
url("http://db.onlinewebfonts.com/t/7ad138835c0cf9f05a9f0ab343247612.ttf") format("truetype"),
url("http://db.onlinewebfonts.com/t/7ad138835c0cf9f05a9f0ab343247612.svg#ProximaNovaSoftW03-Bold") format("svg");
}
/* Resets */
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
form,
body,
html,
p,
blockquote,
fieldset,
input {
margin: 0;
padding: 0;
}
/* Global Styles */
html {
height: 100%;
}
body {
width: 100%;
height: 100%;
background: #222121;
color: #666666;
font-family: 'Lato', sans-serif;
font-size: 16px;
font-weight: normal;
line-height: 24px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a {
color: #1cadeb;
text-decoration: none;
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-ms-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
}
a:hover {
color: #1894c9;
}
a img {
border: 0;
}
ol,
ul {
list-style-type: none;
}
h2 {
padding-bottom: 15px;
color: #3b3b3b;
font-family: 'Fjalla One', sans-serif;
font-size: 36px;
font-weight: normal;
line-height: 1.2em;
}
p {
padding-bottom: 20px;
font-family: 'Lato', sans-serif;
font-size: 16px;
font-weight: normal;
line-height: 1.5em;
}
blockquote {
margin: 2em 0;
padding: 1em;
padding-left: 30px !important;
background: url("quotes.png") no-repeat 0px 25px;
color: #666666;
border-left: 0px !important;
font-family: 'Lato', sans-serif;
font-size: 18px;
font-weight: bold;
line-height: 28px;
}
::-webkit-input-placeholder,
:-moz-placeholder,
::-moz-placeholder,
:-ms-input-placeholder {
color: #666666;
}
input[type="text"],
input[type="email"],
textarea {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
outline: none;
text-shadow: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
border: 0px solid #93c4d3;
}
textarea {
resize: none;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
outline: none;
text-indent: 0.01px;
text-overflow: '';
}
input[type="radio"],
input[type="checkbox"] {
width: 16px;
height: 16px;
border: 1px solid #b2b2ad !important;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
outline: none;
text-shadow: none;
}
input[type="radio"] {
border-radius: 8px;
}
input[type="checkbox"] {
background-color: #ffffff;
border-radius: 0;
}
input[type="radio"]:after {
display: block;
border-radius: 8px;
box-sizing: border-box;
content: " ";
}
input[type="radio"]:checked,
input[type="checkbox"]:checked {
border: 1px solid #1cadeb !important;
}
input[type="radio"]:checked:after {
background: #1cadeb;
border: 2px solid #ffffff;
width: 14px;
height: 14px;
}
input[type="checkbox"]:after {
position: relative;
top: 1px;
left: 4px;
width: 3px;
height: 6px;
border: solid #666666;
border-width: 0 2px 2px 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
input[type="checkbox"]:checked:after {
display: block;
border-color: #1cadeb;
content: " ";
}
.container {
width: 960px;
margin: 0 auto;
}
/* Editor Overrides :: DO NOT REMOVE */
#icontent .wrapper .paris-header,
#preview-iframe .landing-page .wrapper .paris-header,
#icontent.landing-page .wrapper .paris-header,
#icontent .wrapper .banner,
#preview-iframe .landing-page .wrapper .banner,
#icontent.landing-page .wrapper .banner {
opacity: 1 !important;
}
#preview-iframe .landing-page .banner-wrap,
#icontent.landing-page .banner-wrap {
height: 95vh;
min-height: 95vh;
}
body.fade-in-nav .paris-header {
opacity: 1;
}
/* Mobile app */
body.wsite-checkout-page .paris-header,
body.wsite-native-mobile-editor .paris-header {
position: absolute !important;
}
/* Header + Navigation */
.paris-header {
position: fixed;
top: 0;
z-index: 12;
overflow-y: hidden;
width: 100%;
background: #93c4d3 ;
border-top: 5px solid #93c4d3 ;
opacity: 0;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-webkit-transition: opacity 1000ms ease-in;
-moz-transition: opacity 1000ms ease-in;
-ms-transition: opacity 1000ms ease-in;
-o-transition: opacity 1000ms ease-in;
transition: opacity 1000ms ease-in;
}
.paris-header .container {
position: relative;
display: table;
width: 100%;
padding: 0 40px;
box-sizing: border-box;
}
.paris-header .logo {
display: table-cell;
padding-right: 25px;
vertical-align: middle;
color: #ffffff;
font-family: 'Fjalla One', sans-serif;
font-size: 24px;
font-weight: normal;
line-height: normal;
}
.paris-header .logo a {
overflow: hidden;
color: #ffffff;
letter-spacing: .05em;
text-transform: uppercase;
font-family: 'Fjalla One', sans-serif;
font-size: 24px;
font-weight: normal;
line-height: normal;
}
.paris-header .logo a img {
height: auto;
max-height: 50px;
}
.nav {
display: table-cell;
overflow: hidden;
vertical-align: middle;
text-align: center;
}
.nav ul {
float: right;
display: inline-block;
max-width: 1115px;
text-align: left;
}
.nav li {
display: block;
float: left;
-webkit-transition: background 500ms ease;
-moz-transition: background 500ms ease;
-ms-transition: background 500ms ease;
-o-transition: background 500ms ease;
transition: background 500ms ease;
}
.nav li a {
display: block;
color: #ffffff;
padding: 22px 20px;
letter-spacing: .05em;
text-transform: uppercase;
font-family: 'Lato', sans-serif;
font-size: 13px;
font-weight: bold;
line-height: normal;
}
.nav li.wsite-menu-item-wrap#active > a,
.nav li.wsite-menu-subitem-wrap#active > a,
.nav li.wsite-menu-item-wrap > a:hover,
.nav li.wsite-menu-subitem-wrap > a:hover {
background: #1cadeb;
}
.mobile-nav {
display: none;
}
/* Submenus */
#wsite-menus .wsite-menu li a {
padding: 10px 5px;
background: rgba(0, 0, 0, 0.9);
color: #ffffff;
border-bottom: 1px solid #303030;
border-left: none;
border-right: none;
font-family: 'Lato', sans-serif;
font-size: 13px;
font-weight: normal;
line-height: normal;
box-sizing: border-box;
}
#wsite-menus .wsite-menu li a:hover {
background: rgba(0, 0, 0, 0.9);
color: #ffffff;
border-left: 5px solid #1894c9;
}
#wsite-menus .wsite-menu-arrow {
color: transparent;
font-size: 0;
}
#wsite-menus .wsite-menu-arrow:before {
display: block;
color: #ffffff;
content: '\203A';
font-family: 'Lato', sans-serif;
font-size: 24px;
font-weight: normal;
line-height: 11px;
}
/* Mini cart */
#wsite-mini-cart {
position: fixed !important;
top: 80px !important;
overflow-y: scroll;
max-height: 600px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
#wsite-mini-cart .wsite-css-aspect {
width: 50px;
height: 50px;
margin: 10px;
}
/* Banner */
.banner-wrap {
position: relative;
width: 100%;
padding: 55px 0;
box-sizing: border-box;
background: #ffffff url('default-bg.jpg') center center no-repeat;
background-size: cover;
}
.banner-wrap:before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.1);
content: ' ';
}
.banner-wrap .container {
display: table;
overflow-y: hidden;
height: 100%;
}
.banner-wrap .banner {
position: relative;
display: table-cell;
vertical-align: middle;
text-align: center;
}
.banner-wrap .banner h2 {
padding-bottom: 30px;
color: #ffffff;
word-spacing: .1em;
text-transform: uppercase;
font-family: 'Fjalla One', sans-serif;
font-size: 100px;
font-weight: normal;
line-height: 1.1em;
}
.banner-wrap .banner p {
padding-bottom: 40px;
color: #ffffff;
letter-spacing: .03em;
text-transform: uppercase;
font-family: 'Lato', sans-serif;
font-size: 24px;
font-weight: normal;
line-height: 1.4em;
}
.banner-wrap .banner .button-wrap {
display: inline-block;
}
.banner-wrap .banner .wsite-button {
text-align: center !important;
}
.banner-wrap .banner .wsite-button .wsite-button-inner {
background: #1cadeb;
color: #ffffff !important;
}
.banner-wrap .banner .wsite-button:hover .wsite-button-inner {
background: #1894c9;
}
/* Content */
.main-wrap {
background: #ffffff;
}
.main-wrap .content-wrap {
padding: 40px 0 30px;
background: #ffffff;
}
/* Footer */
.footer-wrap {
width: 100%;
background: #222121;
font-size: 13px;
color: #ffffff;
}
.footer-wrap .wsite-footer {
width: 960px;
margin: 0 auto;
padding: 35px 0 20px;
}
.footer-wrap h2 {
color: #989794;
font-family: 'Lato', sans-serif;
font-size: 15px;
font-weight: bold;
line-height: normal;
}
.footer-wrap p {
font-size: 13px;
padding: 0 0 15px;
}
.footer-wrap blockquote {
background: url("quotes.png") no-repeat 0px 15px;
font-size: 15px;
color: #ffffff;
}
.footer-wrap .wsite-form-container {
text-align: left;
margin-top: 0 !important;
}
.footer-wrap .wsite-form-label,
.footer-wrap .form-radio-container {
color: #ffffff;
font-size: 13px;
}
/* Social */
.wsite-social .wsite-social-item {
font-size: 16px;
margin-right: 5px;
}
/* Buttons */
.wsite-button {
height: auto;
padding: 0;
background: none;
-webkit-transition: all 300ms ease;
-moz-transition: all 300ms ease;
-ms-transition: all 300ms ease;
-o-transition: all 300ms ease;
transition: all 300ms ease;
}
.wsite-button:focus {
outline: none;
}
.wsite-button .wsite-button-inner {
display: block;
height: auto;
padding: 12px 16px;
background: #cccbc6;
color: #333333 !important;
border-radius: 4px;
text-transform: uppercase;
letter-spacing: .1em;
white-space: normal;
font-family: 'Lato', sans-serif;
font-size: 14px;
font-weight: 700;
line-height: normal;
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-ms-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
}
.wsite-button.wsite-button-large {
background: none;
}
.wsite-button.wsite-button-large .wsite-button-inner {
padding: 16px 24px;
border-radius: 6px;
font-family: 'Lato', sans-serif;
font-size: 16px;
font-weight: 700;
line-height: normal;
}
.wsite-button:hover .wsite-button-inner {
background: #b2b2ad;
}
.wsite-button.wsite-button-highlight {
background: none;
}
.wsite-button.wsite-button-highlight .wsite-button-inner {
background: #1cadeb;
color: #ffffff !important;
}
.wsite-button.wsite-button-highlight:hover .wsite-button-inner {
background: #1894c9;
}
.wsite-button-large.wsite-button-highlight {
background: none;
}
/* Forms */
.wsite-form-label {
display: inline-block;
color: #3b3b3b;
font-family: 'Lato', sans-serif;
font-size: 15px;
font-weight: normal;
line-height: normal;
}
.wsite-form-sublabel {
display: none;
}
.wsite-form-radio-container {
margin-bottom: 10px;
font-family: 'Lato', sans-serif;
font-size: 14px;
font-weight: normal;
line-height: normal;
}
.wsite-form-radio-container label {
position: relative;
top: 1px;
}
.wsite-form-input,
.wsite-search-element-input {
margin-bottom: 10px;
padding: 8px !important;
background: #ffffff;
border-radius: 0;
border: 1px solid #b2b2ad;
font-family: 'Lato', sans-serif;
font-size: 15px;
font-weight: normal;
line-height: normal;
-webkit-transition: border 300ms ease;
-moz-transition: border 300ms ease;
-ms-transition: border 300ms ease;
-o-transition: border 300ms ease;
transition: border 300ms ease;
}
.wsite-form-input:focus,
.wsite-search-element-input:focus {
border: 1px solid #1cadeb;
}
.form-select,
.wsite-form-field select,
.wsite-com-product-option-groups select {
height: auto;
padding: 8px;
background: #ffffff url(select-dropdown.png) 97% center no-repeat;
border-radius: 0;
border: 1px solid #b2b2ad;
font-family: 'Lato', sans-serif;
font-size: 15px;
font-weight: normal;
line-height: normal;
-webkit-transition: border 300ms ease;
-moz-transition: border 300ms ease;
-ms-transition: border 300ms ease;
-o-transition: border 300ms ease;
transition: border 300ms ease;
}
.form-select:focus,
.wsite-form-field select:focus,
.wsite-com-product-option-groups select:focus {
border: 1px solid #1cadeb;
}
.formlist,
.wsite-editor .formlist {
min-height: inherit;
}
.form-field-error .wsite-form-radio-container {
border: none;
}
.form-field-error .wsite-form-radio-container input[type="radio"],
.form-field-error .wsite-form-radio-container input[type="checkbox"] {
border: 1px solid red;
}
.wsite-search-element-submit,
.wsite-editor .wsite-search-element-submit {
top: 12px;
margin-top: 0;
}
/* Gallery */
.imageGallery {
overflow: hidden;
}
.imageGallery * {
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
.imageGallery .galleryCaptionHolder {
top: 0;
left: 0;
right: 0;
bottom: 0;
height: 100%;
}
.imageGallery .galleryCaptionHolder:hover .galleryCaptionHolderInnerBg {
background: #1894c9;
opacity: .8;
}
.imageGallery .galleryCaptionHolderInner {
height: 100%;
}
.imageGallery .galleryCaptionHolderInnerBg {
background-color: rgba(0, 0, 0, 0.2);
opacity: 1;
-webkit-transition: all 300ms ease;
-moz-transition: all 300ms ease;
-ms-transition: all 300ms ease;
-o-transition: all 300ms ease;
transition: all 300ms ease;
}
.imageGallery .galleryCaptionInnerTextHolder {
position: absolute;
bottom: 0;
width: 100%;
text-align: center;
box-sizing: border-box;
}
.imageGallery .fullImageGalleryCaption .galleryCaptionInnerTextHolder {
position: relative;
}
.imageGallery .galleryCaptionInnerText {
color: #ffffff;
letter-spacing: normal;
text-shadow: none;
font-family: 'Lato', sans-serif;
font-size: 16px;
font-weight: 400;
line-height: 24px;
}
/* Fancybox overrides */
.fancybox-skin {
background: transparent !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
}
.fancybox-title {
color: #ffffff;
font-family: 'Lato', sans-serif;
font-size: 15px;
font-weight: normal;
line-height: normal;
}
.fancybox-close,
.fancybox-next span,
.fancybox-prev span {
background: none !important;
width: auto;
height: auto;
}
.fancybox-close:before,
.fancybox-next span:before,
.fancybox-prev span:before {
color: #ffffff !important;
font-family: 'Lato', sans-serif;
font-size: 45px;
font-weight: normal;
line-height: 0.75em;
-webkit-transition: all 300ms ease;
-moz-transition: all 300ms ease;
-ms-transition: all 300ms ease;
-o-transition: all 300ms ease;
transition: all 300ms ease;
}
.fancybox-close:hover:before,
.fancybox-next:hover span:before,
.fancybox-prev:hover span:before {
color: #1cadeb !important;
}
.fancybox-prev span:before {
position: relative;
left: -10px;
content: '\3008';
}
.fancybox-next span:before {
position: relative;
right: -10px;
content: '\3009';
}
.fancybox-close {
top: 20px;
right: 20px;
}
.fancybox-close:before {
content: '\00D7';
}
/* Landing Page */
.landing-page .banner-wrap {
height: 100vh;
min-height: 100vh;
}
.landing-page .banner-wrap .banner {
opacity: 0;
-webkit-transition: all 1000ms ease;
-moz-transition: all 1000ms ease;
-ms-transition: all 1000ms ease;
-o-transition: all 1000ms ease;
transition: all 1000ms ease;
}
.landing-page #contentArrow {
position: absolute;
display: block;
left: 0;
right: 0;
bottom: 0;
width: 40px;
height: 40px;
margin: 0 auto;
border: 3px solid #ffffff;
border-radius: 100%;
opacity: 0.5;
cursor: pointer;
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-ms-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
}
.landing-page #contentArrow span {
position: relative;
top: 8px;
left: 10px;
content: '\203A';
font-family: 'Lato', sans-serif;
font-size: 24px;
font-weight: normal;
line-height: 11px;
}
.landing-page #contentArrow span:before,
.landing-page #contentArrow span:after {
position: relative;
display: block;
background: #ffffff;
width: 4px;
height: 16px;
content: ' ';
}
.landing-page #contentArrow span:before {
top: 5px;
left: 4px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.landing-page #contentArrow span:after {
top: -11px;
left: 13px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.landing-page #contentArrow:hover {
opacity: 1;
}
/* Fade In */
.landing-page.fade-in .banner {
opacity: 1;
}
/* Tall Header Page */
.tall-header-page .banner-wrap {
display: table;
width: 100%;
min-height: 450px;
padding-top: 50px;
text-align: center;
}
.tall-header-page .banner-wrap .container {
height: 450px;
}
.tall-header-page .banner-wrap .banner h2 {
font-size: 70px;
padding-top: 65px;
}
/* Short Header Page */
.short-header-page .banner-wrap {
display: table;
width: 100%;
min-height: 240px;
padding-top: 50px;
text-align: center;
}
.short-header-page .banner-wrap .container {
height: 240px;
}
.short-header-page .banner-wrap .banner h2 {
font-size: 60px;
padding-top: 65px;
}
/* No Header Page */
.no-header-page .main-wrap {
padding-top: 60px;
}
/* Splash Page */
.splash-page {
position: relative;
top: 0;
left: 0;
width: 100%;
height: 100%;
min-height: 100vh;
background: none;
box-sizing: border-box;
}
.splash-page .wrapper {
height: 100%;
}
.splash-page .main-wrap {
position: relative;
display: table;
width: 100%;
height: 100%;
min-height: 100vh;
background: url(default-bg.jpg) no-repeat;
background-attachment: fixed !important;
background-size: cover;
box-sizing: border-box;
}
.splash-page .main-wrap:before {
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.1);
content: ' ';
}
.splash-page .main-wrap > .container {
position: relative;
display: table;
height: 100%;
padding: 6em 0 4em;
box-sizing: border-box;
}
.splash-page .main-wrap .content-wrap {
display: table-cell;
padding: 0;
vertical-align: middle;
background: none;
}
.splash-page .main-wrap .splash-content h2 {
color: #ffffff;
text-transform: uppercase;
font-size: 70px;
}
.splash-page .main-wrap .splash-content p {
padding: 0 0 25px;
color: #ffffff;
font-family: 'Lato', sans-serif;
font-size: 18px;
font-weight: normal;
line-height: 30px;
}
.splash-page .footer-wrap {
display: none;
}
/* Old styles */
#commentArea {
border-top: solid 1px #dadada;
padding-top: 20px;
}
#wsite-content #commentAreaTitle {
font-size: 26px;
}
#wsite-content #commentAreaTitle,
#wsite-content #commentReplyTitle,
#commentArea .blogCommentText p,
.main-wrap .blog-sidebar h2 {
padding: 0;
}
#commentAreaTitle {
font-family: 'fjalla-one', sans-serif;
}
.blogCommentHeading,
.blogCommentText p {
font-family: inherit;
}
.blogCommentWrap {
background: none;
}
.blogCommentWrap .blogCommentHeading,
.blogCommentWrap .blogCommentHeadingInner,
.blogCommentWrap .blogCommentAuthor {
background: none !important;
}
.blogCommentHeading .blogCommentAuthor span.name,
.blogCommentHeading .blogCommentAuthor span.email {
color: #2a92e5 !important;
float: none;
}
.blogCommentHeading {
padding: 0;
margin-bottom: 20px;
}
.blogCommentHeading .blogCommentAuthor,
.blogCommentHeading .blogCommentDate {
float: none;
text-align: left;
height: auto;
line-height: 1;
padding: 0;
}
.blogCommentHeading .blogCommentAuthor {
text-transform: uppercase;
}
.blogCommentHeading .blogCommentDate {
color: #999;
margin-left: 1em;
}
.blogCommentText {
padding: 0;
}
.blogCommentText p {
color: #666;
font-size: 14px;
}
.blogCommentHeading .blogCommentHeadingInner {
height: auto;
}
.blogCommentWrap .blogCommentHeading .blogCommentHeadingInner .blogCommentAuthor .name {
text-shadow: none;
height: auto;
line-height: 1;
color: #3b3b3b !important;
float: none;
}
.blogCommentHeading .blogCommentHeadingInner .blogCommentAuthor .link {
margin: 0 5px;
float: none;
display: inline-block;
}
.blogCommentHeading .blogCommentAuthor,
.blogCommentHeading .blogCommentDate {
float: none;
text-align: left;
height: auto;
line-height: 1;
padding: 0;
display: inline;
vertical-align: baseline;
text-transform: none;
}
I cut some of the code, it was to long to submit, but I only deleted the #mediascreen parts of it :)
It doesn't work because you aren't actually assigning the font:
h2 {
/* font-family: 'Fjalla One', sans-serif; */
font-family: 'PNS', sans-serif;
}

CSS Button Hover Effect (Border Change, Background Change) Not Working

I'm new to programming. I'm interested in recreating the button effect from this codepen example. Codepen
When I copy the code from codepen and try to run the code in my Chrome browser, the button 1) did not have the border effect, 2) was not positioned in the middle of the screen, and 3) the background change effect did not show up.
Here is the code I try to run in my browser, which I borrow from this codepen aforementioned. Codepen
CSS
$alizarin: #e74c3c;
%vertical-align {
position: relative;
top: 50%;
transform: translateY(-50%);
}
*,
*::before,
*::after { box-sizing: border-box; }
html,
body {
width: 100%;
height: 100%;
}
body {
position: relative;
font-family: "Lato", "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
font-weight: 300;
text-align: center;
overflow: hidden;
background: url(http://magdeleine.co/wp-content/uploads/2015/01/tongariro-national-park-493289-1400x933.jpg) no-repeat center center;
background-size: cover;
&:after {
content: "";
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
background: linear-gradient(135deg, #2980b9 0%,#9B59B6 100%);
background-size: 100% auto;
opacity: 0;
transition: all .65s ease-in-out;
}
}
.blur:after { opacity: .85; }
.btn {
position: relative;
display: inline-block;
border: 6px solid lighten($alizarin, 10%);
#extend %vertical-align;
transition: all .1s ease-in-out;
z-index: 99;
&.active { box-shadow: 2px 2px 4px rgba(0,0,0, .25); }
&:focus,
&:hover { border: 12px solid $alizarin; }
}
.btn,
.btn > span {
cursor: pointer;
}
.btn > span {
min-width: 426px;
}
.btn-inr {
display: inline-block;
color: white;
font-weight: 100;
font-size: 2em;
line-height: 1;
text-transform: uppercase;
background: lighten($alizarin, 10%);
padding: 1em 2em;
margin: 6px;
transition: all .1s ease-in-out;
&:focus,
&:hover {
background: $alizarin;
padding: 1em 2em;
margin: 0;
}
}
.txt-a {
display: inline;
}
.txt-b {
display: none;
}
.btn:focus .btn-inr,
.btn:hover .btn-inr {
background: $alizarin;
padding: 1em 2em;
margin: 0;
}
.btn:focus .txt-a,
.btn:hover .txt-a { display: none; }
.btn:focus .txt-b,
.btn:hover .txt-b { display: inline; }
HTML
<a class="btn" data-js="btn">
<span class="btn-inr">
<span class="txt-a">See this button?</span>
<span class="txt-b">Now ya do.</span>
</span>
</a>
JavaScript
function toggleButton(el) {
var body = document.body;
var element = document.querySelector(el);
element.addEventListener('mouseenter', function(e) {
e.target.classList.add('active');
body.classList.add('blur');
}, false);
element.addEventListener('mouseleave', function(e) {
e.target.classList.remove('active');
body.classList.remove('blur');
}, false);
};
toggleButton('[data-js="btn"]');
Help is greatly appreciated. Thank you everyone!
the css you copied are some sort of SASS i think, you need to copy the compiled version of css
http://codepen.io/cdunnnnnnn/pen/FLsvf in the css column, there is a button say "view compiled", click on that and copy css again.
.btn {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
}
body {
position: relative;
font-family: "Lato", "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
font-weight: 300;
text-align: center;
overflow: hidden;
background: url(http://magdeleine.co/wp-content/uploads/2015/01/tongariro-national-park-493289-1400x933.jpg) no-repeat center center;
background-size: cover;
}
body:after {
content: "";
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
background: -webkit-linear-gradient(315deg, #2980b9 0%, #9B59B6 100%);
background: linear-gradient(135deg, #2980b9 0%, #9B59B6 100%);
background-size: 100% auto;
opacity: 0;
-webkit-transition: all .65s ease-in-out;
transition: all .65s ease-in-out;
}
.blur:after {
opacity: .85;
}
.btn {
position: relative;
display: inline-block;
border: 6px solid #ed7669;
-webkit-transition: all .1s ease-in-out;
transition: all .1s ease-in-out;
z-index: 99;
}
.btn.active {
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
}
.btn:focus, .btn:hover {
border: 12px solid #e74c3c;
}
.btn,
.btn > span {
cursor: pointer;
}
.btn > span {
min-width: 426px;
}
.btn-inr {
display: inline-block;
color: white;
font-weight: 100;
font-size: 2em;
line-height: 1;
text-transform: uppercase;
background: #ed7669;
padding: 1em 2em;
margin: 6px;
-webkit-transition: all .1s ease-in-out;
transition: all .1s ease-in-out;
}
.btn-inr:focus, .btn-inr:hover {
background: #e74c3c;
padding: 1em 2em;
margin: 0;
}
.txt-a {
display: inline;
}
.txt-b {
display: none;
}
.btn:focus .btn-inr,
.btn:hover .btn-inr {
background: #e74c3c;
padding: 1em 2em;
margin: 0;
}
.btn:focus .txt-a,
.btn:hover .txt-a {
display: none;
}
.btn:focus .txt-b,
.btn:hover .txt-b {
display: inline;
}
You need to compile the SCSS code into pure CSS!
DEMO
// http://shoptalkshow.com/episodes/134-marc-grabanski/#t=16:07
// vanilla JS
function toggleButton(el) {
var body = document.body;
var element = document.querySelector(el);
element.addEventListener('mouseenter', function(e) {
e.target.classList.add('active');
body.classList.add('blur');
}, false);
element.addEventListener('mouseleave', function(e) {
e.target.classList.remove('active');
body.classList.remove('blur');
}, false);
};
toggleButton('[data-js="btn"]');
// jQuery
/*
$('[data-js="btn"]').hover(function(){
$(this).toggleClass('active');
if ($(this).hasClass('active')) {
$('body').addClass('blur');
} else {
$('body').removeClass('blur');
}
});
*/
html,
body {
width: 100%;
height: 100%;
margin: 0;
}
.btn {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
}
body {
position: relative;
font-family: "Lato", "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
font-weight: 300;
text-align: center;
overflow: hidden;
background: url(http://magdeleine.co/wp-content/uploads/2015/01/tongariro-national-park-493289-1400x933.jpg) no-repeat center center;
background-size: cover;
}
body:after {
content: "";
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
background: -webkit-linear-gradient(315deg, #2980b9 0%, #9B59B6 100%);
background: linear-gradient(135deg, #2980b9 0%, #9B59B6 100%);
background-size: 100% auto;
opacity: 0;
-webkit-transition: all .65s ease-in-out;
transition: all .65s ease-in-out;
}
.blur:after {
opacity: .85;
}
.btn {
position: relative;
display: inline-block;
border: 6px solid #ed7669;
-webkit-transition: all .1s ease-in-out;
transition: all .1s ease-in-out;
z-index: 99;
}
.btn.active {
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
}
.btn:focus,
.btn:hover {
border: 12px solid #e74c3c;
}
.btn,
.btn > span {
cursor: pointer;
}
.btn > span {
min-width: 426px;
}
.btn-inr {
display: inline-block;
color: white;
font-weight: 100;
font-size: 2em;
line-height: 1;
text-transform: uppercase;
background: #ed7669;
padding: 1em 2em;
margin: 6px;
-webkit-transition: all .1s ease-in-out;
transition: all .1s ease-in-out;
}
.btn-inr:focus,
.btn-inr:hover {
background: #e74c3c;
padding: 1em 2em;
margin: 0;
}
.txt-a {
display: inline;
}
.txt-b {
display: none;
}
.btn:focus .btn-inr,
.btn:hover .btn-inr {
background: #e74c3c;
padding: 1em 2em;
margin: 0;
}
.btn:focus .txt-a,
.btn:hover .txt-a {
display: none;
}
.btn:focus .txt-b,
.btn:hover .txt-b {
display: inline;
}
<a class="btn" data-js="btn">
<span class="btn-inr">
<span class="txt-a">See this button?</span>
<span class="txt-b">Now ya do.</span>
</span>
</a>