I am using a bootstrap template and I am a beginner.
I want to change the backgroud blue color into a color of my choice.
I also want to change the color of the button.
I tried playing around with CSS files, but i failed.
main.css :
/*//////////////////////////////////////////////////////////////////
[ FONT ]*/
#font-face {
font-family: Montserrat-Regular;
src: url('../fonts/montserrat/Montserrat-Regular.ttf');
}
#font-face {
font-family: Montserrat-ExtraBold;
src: url('../fonts/montserrat/Montserrat-ExtraBold.ttf');
}
#font-face {
font-family: Montserrat-Bold;
src: url('../fonts/montserrat/Montserrat-Bold.ttf');
}
/*//////////////////////////////////////////////////////////////////
[ RESTYLE TAG ]*/
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
body, html {
height: 100%;
font-family: Montserrat-Regular, sans-serif;
}
/*---------------------------------------------*/
a {
font-family: Montserrat-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: #fff;
}
/*---------------------------------------------*/
h1,h2,h3,h4,h5,h6 {
margin: 0px;
}
p {
font-family: Montserrat-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:focus::-webkit-input-placeholder { color:transparent; }
input:focus:-moz-placeholder { color:transparent; }
input:focus::-moz-placeholder { color:transparent; }
input:focus:-ms-input-placeholder { color:transparent; }
textarea:focus::-webkit-input-placeholder { color:transparent; }
textarea:focus:-moz-placeholder { color:transparent; }
textarea:focus::-moz-placeholder { color:transparent; }
textarea:focus:-ms-input-placeholder { color:transparent; }
input::-webkit-input-placeholder { color: #999999; }
input:-moz-placeholder { color: #999999; }
input::-moz-placeholder { color: #999999; }
input:-ms-input-placeholder { color: #999999; }
textarea::-webkit-input-placeholder { color: #999999; }
textarea:-moz-placeholder { color: #999999; }
textarea::-moz-placeholder { color: #999999; }
textarea:-ms-input-placeholder { color: #999999; }
/*---------------------------------------------*/
button {
outline: none !important;
border: none;
background: transparent;
}
button:hover {
cursor: pointer;
}
iframe {
border: none !important;
}
/*//////////////////////////////////////////////////////////////////
[ Utility ]*/
.txt1 {
font-family: Montserrat-Regular;
font-size: 16px;
color: #cccccc;
line-height: 1.4;
}
.bo1 {
border-bottom: 1px solid #999999;
}
.hov1:hover {
border-color: #d33f8d;
}
/*//////////////////////////////////////////////////////////////////
[ login ]*/
.limiter {
width: 100%;
margin: 0 auto;
}
.container-login100 {
width: 100%;
min-height: 100vh;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
padding: 15px;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
position: relative;
z-index: 1;
}
.container-login100::before {
content: "";
display: block;
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: #005bea;
background: -webkit-linear-gradient(bottom, #005bea, #00c6fb);
background: -o-linear-gradient(bottom, #005bea, #00c6fb);
background: -moz-linear-gradient(bottom, #005bea, #00c6fb);
background: linear-gradient(bottom, #005bea, #00c6fb);
opacity: 0.9;
}
.wrap-login100 {
width: 390px;
background: transparent;
}
/*------------------------------------------------------------------
[ ]*/
.login100-form {
width: 100%;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.login100-form-title {
font-family: Montserrat-ExtraBold;
font-size: 24px;
color: #fff;
line-height: 1.2;
text-align: center;
width: 100%;
display: block;
}
/*---------------------------------------------*/
.login100-form-avatar {
width: 120px;
height: 120px;
border-radius: 50%;
overflow: hidden;
margin: 0 auto;
}
.login100-form-avatar img {
width: 100%;
}
/*---------------------------------------------*/
.wrap-input100 {
position: relative;
width: 100%;
z-index: 1;
}
.input100 {
font-family: Montserrat-Bold;
font-size: 15px;
line-height: 1.2;
color: #333333;
display: block;
width: 100%;
background: #fff;
height: 50px;
border-radius: 25px;
padding: 0 30px 0 53px;
}
/*------------------------------------------------------------------
[ Focus ]*/
.focus-input100 {
display: block;
position: absolute;
border-radius: 25px;
bottom: 0;
left: 0;
z-index: -1;
width: 100%;
height: 100%;
box-shadow: 0px 0px 0px 0px;
color: rgba(0,91,234, 0.6);
}
.input100:focus + .focus-input100 {
-webkit-animation: anim-shadow 0.5s ease-in-out forwards;
animation: anim-shadow 0.5s ease-in-out forwards;
}
#-webkit-keyframes anim-shadow {
to {
box-shadow: 0px 0px 80px 30px;
opacity: 0;
}
}
#keyframes anim-shadow {
to {
box-shadow: 0px 0px 80px 30px;
opacity: 0;
}
}
.symbol-input100 {
font-size: 15px;
color: #999999;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
align-items: center;
position: absolute;
border-radius: 25px;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
padding-left: 30px;
pointer-events: none;
-webkit-transition: all 0.4s;
-o-transition: all 0.4s;
-moz-transition: all 0.4s;
transition: all 0.4s;
}
.input100:focus + .focus-input100 + .symbol-input100 {
color: #00c6fb;
padding-left: 23px;
}
/*------------------------------------------------------------------
[ Button ]*/
.container-login100-form-btn {
width: 100%;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.login100-form-btn {
font-family: Montserrat-Bold;
font-size: 15px;
line-height: 1.5;
color: #e0e0e0;
width: 100%;
height: 50px;
border-radius: 25px;
background: #333333;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
justify-content: center;
align-items: center;
padding: 0 25px;
-webkit-transition: all 0.4s;
-o-transition: all 0.4s;
-moz-transition: all 0.4s;
transition: all 0.4s;
position: relative;
z-index: 1;
}
.login100-form-btn::before {
content: "";
display: block;
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
border-radius: 25px;
top: 0;
left: 0;
background: #005bea;
background: -webkit-linear-gradient(left, #005bea, #00c6fb);
background: -o-linear-gradient(left, #005bea, #00c6fb);
background: -moz-linear-gradient(left, #005bea, #00c6fb);
background: linear-gradient(left, #005bea, #00c6fb);
-webkit-transition: all 0.4s;
-o-transition: all 0.4s;
-moz-transition: all 0.4s;
transition: all 0.4s;
opacity: 0;
}
.login100-form-btn:hover {
background: transparent;
color: #fff;
}
.login100-form-btn:hover:before {
opacity: 1;
}
/*------------------------------------------------------------------
[ Button sign in with ]*/
.btn-face,
.btn-google {
font-family: Raleway-Bold;
font-size: 16px;
line-height: 1.2;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
justify-content: center;
align-items: center;
width: calc((100% - 10px) / 2);
height: 40px;
border-radius: 3px;
border: 1px solid #e6e6e6;
background-color: #fff;
-webkit-transition: all 0.4s;
-o-transition: all 0.4s;
-moz-transition: all 0.4s;
transition: all 0.4s;
}
.btn-face {
color: #3b5998;
}
.btn-face i {
font-size: 20px;
margin-right: 10px;
padding-bottom: 1px;
}
.btn-google {
color: #555555;
}
.btn-google img {
width: 19px;
margin-right: 10px;
padding-bottom: 1px;
}
.btn-face:hover,
.btn-google:hover {
border-color: #d33f8d;
}
/*------------------------------------------------------------------
[ Alert validate ]*/
.validate-input {
position: relative;
}
.alert-validate::before {
content: attr(data-validate);
position: absolute;
max-width: 70%;
background-color: white;
border: 1px solid #c80000;
border-radius: 14px;
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: 8px;
pointer-events: none;
font-family: Montserrat-Bold;
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;
display: block;
position: absolute;
color: #c80000;
font-size: 15px;
top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
right: 13px;
}
.alert-validate:hover:before {
visibility: visible;
opacity: 1;
}
#media (max-width: 992px) {
.alert-validate::before {
visibility: visible;
opacity: 1;
}
}
/*//////////////////////////////////////////////////////////////////
[ responsive ]*/
#media (max-width: 576px) {
.wrap-login100 {
padding-top: 80px;
padding-left: 15px;
padding-right: 15px;
}
}
I also wanted to change the color of the button.
I tried with no luck.
In addition, I noticed that if there are two different shades of blue. The upper shade is lighter than the lower shade.
I attached some screenshots.
Please help me to change the background and button colors.
This is blue color in the upper section of the page,
This is the second blue shade in the lower part of the page,
You can always override bootstrap defaults by adding an additional css, after bootrap and the theme's css.
I use for example
.btn-primary {
color: #fff;
background-color: #007078;
border-color: #92CDDC;
}
Other bootstrap classes you may want to override for color consistency are all the *primary classes like
.bg-primary, .table-primary, .table-primary > th, .table-primary > td, .badge-primary, .text-primary, a.text-primary:focus,a.text-primary:hover
Hope this helps you
There are many background color classes provided by Bootstrap such as : bg-primary, bg-info, bg-success...etc. You can overwrite it in you CSS as follow :
.bg-info {
background-color: <YourColor>;
}
For the background color, try adding the background color property to the body like this;
body, html {
height: 100%;
font-family: Montserrat-Regular, sans-serif;
background-color: <color of choice>;
}
Add the same property to your button and add a color you want. Hope it works.
Related
When I try to set the position of a button as "relative" in this specific web.
the width of the page gets increased as you can see by the code provided in snippet, will appreciate if you take a look (Specifically "btn-links1 & btn-links2" classes)
(Absolute value doesn't work as the buttons get misplaced when minimizing the browser window)
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--main-color: #00C9A6;
--second-color: #27242B;
--third-color: #545058;
--fourth-color: #FAEAFF;
}
html {
scroll-behavior: smooth;
}
body {
background-color: var(--third-color);
font-family: 'Roboto', sans-serif;
}
.nav-bar {
-webkit-backdrop-filter: blur(8px);
backdrop-filter: blur(8px);
display: flex;
position: fixed;
padding: 15px;
/* background-color: var(--second-color); */
width: 100%;
height: 60px;
z-index: 1030;
}
.active {
border-bottom: 1px solid var(--fourth-color);
}
.logo {
position: relative;
bottom: 4px;
height: 40px;
display: inline-block;
background-color: var(--fourth-color);
transition: .2s;
}
.logo img {
width: 50px;
}
.logo:hover {
opacity: .5;
}
.nav-bar .links li {
padding: 7px;
display: inline-block;
justify-content: space-around;
}
.nav-bar .links {
left: 30px;
position: relative;
/* margin: 10px 0; */
}
.nav-bar .links li a {
list-style: none;
text-decoration: none;
margin-top: 15px;
padding: 0 15px 0 15px;
color: var(--main-color);
text-transform: capitalize;
font-weight: 700;
transition: .2s ease-in-out;
}
.nav-bar .links li:hover a {
color: #00c9a7b9;
}
#home {
position: relative;
width: 100%;
height: 500px;
background-color: var(--third-color);
z-index: 1;
}
.img{
background-image: url(../imgs/Dustin+vs+Claudio_.jpg);
position: absolute;
background-size: cover;
width: 100%;
height: 500px;
z-index: 2;
}
.overlay {
position: absolute;
width: 100%;
height: 500px;
background-color: rgba(33, 31, 35, 0.569);
z-index: 3;
}
.titles h1 {
position: absolute;
font-size: 100px;
font-style: italic;
color: var(--main-color);
z-index: 4;
text-align: center;
top: 0;
left: 170px;
margin: 155px 0;
padding: 5px;
text-transform: capitalize;
}
/* start Button styling */
.btn-link1 {
position: relative;
left: 297px;
bottom: 208px;
text-decoration: none;
}
.btn-link1 a{
position: absolute;
width: 0;
text-decoration: none;
}
.button-86 {
all: unset;
width: 100px;
height: 30px;
font-size: 16px;
background: transparent;
border: none;
position: relative;
color: var(--third-color);
cursor: pointer;
z-index: 1;
padding: 10px 20px;
display: flex;
align-items: center;
justify-content: center;
white-space: nowrap;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
}
.button-86::after,
.button-86::before {
content: '';
position: absolute;
bottom: 0;
right: 0;
z-index: -99999;
transition: all .4s;
}
.button-86::before {
transform: translate(0%, 0%);
width: 100%;
height: 100%;
background: var(--fourth-color);
border-radius: 10px;
}
.button-86::after {
transform: translate(10px, 10px);
width: 35px;
height: 35px;
background: #ffffff15;
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
border-radius: 50px;
}
.button-86:hover::before {
transform: translate(5%, 20%);
width: 110%;
height: 110%;
background-color: var(--main-color);
}
.button-86:hover::after {
border-radius: 10px;
transform: translate(0, 0);
width: 100%;
height: 100%;
}
.button-86:active::after {
transition: 0s;
transform: translate(0, 5%);
}
.btn-link1 a span {
font-weight: bold;
transition: all .3s ease-in 0s;
}
.btn-link1:hover a span {
/* font-weight: bold; */
color: black;
}
.btn-link1:hover .fa-instagram {
color: black;
}
.fa-instagram {
/* font-weight: bold; */
color: rgb(120, 5, 221);
margin: 5px;
transition: all .3s ease-in 0s;
}
/* end Button instagram styling */
/* start Button linked in styling */
.btn-link2 {
position: relative;
left: 575px;
bottom: 208px;
text-decoration: none;
}
.btn-link2 a{
position: absolute;
width: 0;
text-decoration: none;
}
.button-87 {
all: unset;
width: 100px;
height: 30px;
font-size: 16px;
background: transparent;
border: none;
position: relative;
color: var(--third-color);
cursor: pointer;
z-index: 1;
padding: 10px 20px;
display: flex;
align-items: center;
justify-content: center;
white-space: nowrap;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
}
.button-87::after,
.button-87::before {
content: '';
position: absolute;
bottom: 0;
right: 0;
z-index: -99999;
transition: all .4s;
}
.button-87::before {
transform: translate(0%, 0%);
width: 100%;
height: 100%;
background: var(--fourth-color);
border-radius: 10px;
}
.button-87::after {
transform: translate(10px, 10px);
width: 35px;
height: 35px;
background: #ffffff15;
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
border-radius: 50px;
}
.button-87:hover::before {
transform: translate(5%, 20%);
width: 110%;
height: 110%;
background-color: var(--main-color);
}
.button-87:hover::after {
border-radius: 10px;
transform: translate(0, 0);
width: 100%;
height: 100%;
}
.button-87:active::after {
transition: 0s;
transform: translate(0, 5%);
}
.btn-link2 a span {
font-weight: bold;
transition: all .3s ease-in 0s;
}
.btn-link2:hover a span {
/* font-weight: bold; */
color: rgb(0, 162, 255);
}
.btn-link2:hover .fa-linkedin {
color: black;
}
.fa-linkedin {
color: rgb(0, 162, 255);
margin: 5px;
transition: all .3s ease-in 0s;
}
/* end Button linked in styling */
<div class="nav-bar">
<a class="logo" href="#home">
<img src="imgs/lw-logo.png" alt="">
</a>
<ul class="links">
<li class="active">home</li>
<li>portraits</li>
<li>behind the scenes</li>
<li>action</li>
<li>fine art</li>
<li>contact me</li>
</ul>
</div>
<div id="home">
<div class="background">
<div class="img"></div>
<div class="overlay"></div>
</div>
<div class="titles">
<h1>lw photography</h1>
</div>
</div>
<div class="btn-link1">
<a href="https://www.instagram.com">
<button class="button-86" role="button">
<i class="fa-brands fa-instagram"></i>
<span>Instagram</span>
</button>
</a>
</div>
<div class="btn-link2">
<a href="https://www.linkedin.com/in/lane-walbert-0b838a9a/">
<button class="button-87" role="button">
<i class="fa-brands fa-linkedin"></i>
<span>LinkedIn</span>
</button>
</a>
</div>
Scroll bar down bottom as page width got increased
I'm really struggling with an issue that is hard to describe. I've included a JSFiddle here: https://jsfiddle.net/z8L392ug/
enter code here
Basically the issue is that I have a news API that I am calling for F1 stories. I can call the API successfully, but the component on the page that houses the news articles isn't working correctly. The correct functionality can be found on this site:
https://drivetodescribe.com/news.html (please note this page has to be updated manually and isn't calling the news API)
Can anyone help me or point me in the right direction to get these components working correctly??
Writing a question
In order to resolve your issue, you should provide us with enough information to answer your questions.
but the component on the page that houses the news articles isn't working correctly.
Is rather vague. Other people don't have the context you're working with and have to go on a scavenger hunt to find what you actually mean.
you could rewrite your question like.
"I render a list of tiles . The data is coming from an api call. In each tile has a button on the top right. Clicking the button should cause the tile's content to change. this is not happening"
Attaching handlers
you have a function in your code that runs when the page loads. That piece of code attache a click handler to the .mc-btn-action elements.
When this function runs. it will look for all items in the DOM that have that class.
When your api-call is still fetching, this piece of code cannot find any elements. (as they will only be added when the api call finishes)
Attaching it after the tiles are added to the DOM.
you can attach the handlers whenever you're certain the elements are in the DOM. For example in your render function
function renderCountries(countries) {
const countriesContainer = document.getElementById('myUL');
if (countries.length > 0) {
countriesContainer.innerHTML = countries
.map(country => cardTemplate(country))
.join(' ');
$('.material-card > .mc-btn-action').click(onHelmetClick);
} else {
countriesContainer.innerHTML = '<p>No countries found.</p>';
}
}
Example
$(function() {
$('.material-card > .mc-btn-action').click(onHelmetClick);
});
function onHelmetClick() {
var card = $(this).parent('.material-card');
var icon = $(this).children('i');
icon.addClass('fa-spin-fast');
if (card.hasClass('mc-active')) {
card.removeClass('mc-active');
window.setTimeout(function() {
icon
.removeClass('fa-arrow-left')
.removeClass('fa-spin-fast')
.addClass('fa-bars');
}, 800);
} else {
card.addClass('mc-active');
window.setTimeout(function() {
icon
.removeClass('fa-bars')
.removeClass('fa-spin-fast')
.addClass('fa-arrow-left');
}, 800);
}
}
function myFunction() {
var input, filter, ul, li, a, i, txtValue;
input = document.getElementById('myInput');
filter = input.value.toUpperCase();
ul = document.getElementById("myUL");
li = ul.getElementsByTagName('li');
for (i = 0; i < li.length; i++) {
a = li[i].getElementsByTagName("a")[0];
txtValue = a.textContent || a.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
li[i].style.display = "";
} else {
li[i].style.display = "none";
}
}
}
function onHelmetClick() {
var card = $(this).parent('.material-card');
var icon = $(this).children('i');
icon.addClass('fa-spin-fast');
if (card.hasClass('mc-active')) {
card.removeClass('mc-active');
window.setTimeout(function() {
icon
.removeClass('fa-arrow-left')
.removeClass('fa-spin-fast')
.addClass('fa-bars');
}, 800);
} else {
card.addClass('mc-active');
window.setTimeout(function() {
icon
.removeClass('fa-bars')
.removeClass('fa-spin-fast')
.addClass('fa-arrow-left');
}, 800);
}
}
function renderCountries(countries) {
const countriesContainer = document.getElementById('myUL');
if (countries.length > 0) {
countriesContainer.innerHTML = countries
.map(country => cardTemplate(country))
.join(' ');
$('.material-card > .mc-btn-action').click(onHelmetClick);
} else {
countriesContainer.innerHTML = '<p>No countries found.</p>';
}
}
function cardTemplate(data) {
return `
<li class="li-no-hover"><div class="profile">
<article class="material-card Profile">
<a style="text-decoration: none;" href="">
<h2><strong>${data.headline}</strong></h2>
<div class="mc-content">
<div class="img-container">
<img src="${data.image}" alt="Sidepods" style="height: 100%; background-position: center;";>
</div></a>
<div class="mc-description" style="text-align: left; line-height: 135%;">
<p style="text-align: center;">${data.story}</p>
<div class="mc-description-bottom">
<h5>${data.byline}</h5></div>
</div></div>
<a class="mc-btn-action">
<img style="width:60%" src="/page-assets/d2d-icon(left).svg"></a>
</article></div></li>
`;
}
(function start() {
const url =
'https://script.google.com/macros/s/AKfycbzXIL78B0c6lF10Ekhj9c77NXfhyoeFtBIR7RaswQMNv36P4P1laLu03J0WjngMgaXE/exec';
fetch(url)
.then(res => {
return res.json();
})
.then(json => {
COUNTRIES = json.data;
renderCountries(COUNTRIES);
addDropdownOptions(COUNTRIES);
});
})();
$(function() {
$('.material-card > .mc-btn-action').click(onHelmetClick);
});
#import url('https://fonts.googleapis.com/css2?family=Aclonica&family=Audiowide&family=Black+Ops+One&family=Bungee&family=Bungee+Hairline&family=Bungee+Inline&family=Bungee+Outline&family=Bungee+Shade&family=Days+One&family=Michroma&family=Monoton&family=Racing+Sans+One&family=Titillium+Web:ital,wght#0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap');
#font-face {
font-family: D2DTitle1;
src: url(fonts/Formula1-Regular_web_0.ttf);
}
#font-face {
font-family: D2DTitle2;
src: url(fonts/Formula1-Bold_web_0.ttf);
}
#font-face {
font-family: D2DTitle3;
src: url(fonts/Formula1-Wide_web_0.ttf);
}
#font-face {
font-family: D2DBody1;
src: url(fonts/TitilliumWeb-ExtraLight.ttf);
}
#font-face {
font-family: D2DBody2;
src: url(fonts/TitilliumWeb-Light.ttf);
}
#font-face {
font-family: D2DBody3;
src: url(fonts/TitilliumWeb-Regular.ttf);
}
#font-face {
font-family: D2DBody4;
src: url(fonts/TitilliumWeb-SemiBold.ttf);
}
#font-face {
font-family: D2DBody5;
src: url(fonts/TitilliumWeb-SuperBold.ttf);
}
#font-face {
font-family: D2DBody6;
src: url(fonts/TitilliumWeb-SuperSuperBlack.ttf);
}
#font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?oymsdl');
src: url('fonts/icomoon.eot?oymsdl#iefix') format('embedded-opentype'), url('fonts/icomoon.ttf?oymsdl') format('truetype'), url('fonts/icomoon.woff?oymsdl') format('woff'), url('fonts/icomoon.svg?oymsdl#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}
[class^="icon-"],
[class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon' !important;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-news:before {
content: "\e900";
}
.icon-flag:before {
content: "\e901";
}
.icon-helmet:before {
content: "\e902";
}
.icon-wheel:before {
content: "\e903";
}
.icon-specials:before {
content: "\e91c";
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #000000;
color: #ffffff;
box-sizing: border-box;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-family: 'D2DBody2';
min-height: 100vh;
text-align: center;
overflow-x: hidden;
}
body>* {
width: 100%;
}
h1,
h2,
h3,
h7 {
text-transform: uppercase;
text-align: center;
}
h1 {
font-size: 35pt;
color: black;
text-shadow: 0 0 4px white;
font-family: 'D2DTitle2', sans-serif;
margin: 1.5rem 0;
}
h2 {
font-size: 18pt;
color: white;
font-family: 'D2DTitle2', sans-serif;
}
h3 {
font-size: 14pt;
color: white;
text-align: center;
font-family: 'D2DTitle2', sans-serif;
}
h4 {
font-size: 11pt;
color: white;
text-align: left;
font-family: 'D2DBody1';
}
h5 {
font-size: 8pt;
font-style: italic;
margin-right: 10px;
color: white;
text-align: right;
font-family: 'D2DBody1';
}
h6 {
font-size: 10pt;
color: white;
text-align: center;
font-family: 'D2DBody1';
}
h7 {
font-size: 12pt;
color: white;
text-align: center;
font-family: 'D2DTitle2', sans-serif;
}
p {
font-size: 12pt;
margin-bottom: 12pt;
font-family: 'D2DBody1', sans-serif;
}
h8 {
font-size: 12pt;
margin-bottom: 12pt;
font-family: 'D2DBody4', sans-serif;
}
.container {
max-width: 90%;
margin: 0 auto;
}
#about {
top: 1em;
background-color: black;
font-weight: 500;
font-family: 'D2DTitle2';
}
#media screen and (max-width: 915px) {
h1 {
font-size: 25pt;
}
h2 {
font-size: 14pt;
}
p {
font-size: 11pt;
}
}
.countries-container {
margin-top: 2rem;
margin-bottom: 2rem;
width: 100%;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
}
.countries-container .card {
position: relative;
width: 250px;
margin: 0 1rem 1rem 0;
background-color: #4D4D4D;
cursor: pointer;
-webkit-transition: all 0.2s ease-out;
transition: all 0.2s ease-out;
}
.countries-container .card .card-header .card-title {
color: white;
display: absolute;
margin: 0;
text-align: center;
line-height: 1.2;
padding: 0.5rem 0.75rem;
white-space: pre-wrap;
}
.countries-container .card .card-header img {
display: absolute;
height: 167px;
-o-object-fit: cover;
object-fit: cover;
}
.countries-container .card .card-body {
padding: 0.5rem 0.75rem;
}
.countries-container .card .card-body .card-body-item {
margin-bottom: 0.5rem;
}
.countries-container .card .card-body .card-body-item:last-child {
margin-bottom: 0;
}
.countries-container .card .card-body .card-body-item p {
margin: 0;
}
.card-img-caption .card-img-top {
z-index: 0;
}
.linkicons {
width: 30px;
}
.race-container {
position: relative;
text-align: center;
color: white;
height: 150px;
width: 90%;
overflow: hidden;
background-size: cover;
background-position: center;
}
.r-result {
position: absolute;
color: white;
top: 40%;
right: 5%;
font-family: 'D2DTitle2', sans-serif;
font-size: 1.5em;
text-shadow: .1em .1em #4D4D4D;
text-transform: uppercase;
-webkit-text-stroke-width: 1.3px;
-webkit-text-stroke-color: black;
}
.points {
position: absolute;
color: white;
top: 70%;
right: 5%;
font-family: 'D2DTitle2', sans-serif;
font-size: 1.5em;
text-shadow: .1em .1em #4D4D4D;
text-transform: uppercase;
-webkit-text-stroke-width: 1.3px;
-webkit-text-stroke-color: black;
}
.q-result {
position: absolute;
color: white;
top: 10%;
right: 5%;
font-family: 'D2DTitle2', sans-serif;
font-size: 1.5em;
text-shadow: .1em .1em #4D4D4D;
text-transform: uppercase;
-webkit-text-stroke-width: 1.3px;
-webkit-text-stroke-color: black;
}
.round-name {
position: absolute;
color: white;
top: 40%;
left: 5%;
font-family: 'D2DTitle2', sans-serif;
font-size: 1.5em;
text-shadow: .1em .1em #4D4D4D;
text-transform: uppercase;
-webkit-text-stroke-width: 1.3px;
-webkit-text-stroke-color: black;
}
.specials {
position: relative;
text-align: center;
color: white;
width: 90%;
overflow: hidden;
background-size: cover;
background-position: center;
font-family: 'D2DTitle2', sans-serif;
font-size: 30px;
text-transform: uppercase;
}
.grid-container {
display: grid;
grid-template-columns: 25% 25%;
grid-gap: 50%;
font-size: 3em;
}
.countries-container .profile {
position: relative;
width: 300px;
margin: 1em 1em 1em 1em;
background-color: #000000;
cursor: pointer;
-webkit-transition: all 0.2s ease-out;
transition: all 0.2s ease-out;
}
.countries-container .circuit {
position: relative;
width: 275px;
margin: .75em .75em .75em .75em;
background-color: #000000;
cursor: pointer;
-webkit-transition: all 0.2s ease-out;
transition: all 0.2s ease-out;
}
.material-card {
position: relative;
padding-bottom: calc(100% - 16px);
margin-bottom: 1em;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
border: 2px solid #fff;
}
.material-card h2 {
position: absolute;
top: calc(100% - 54px);
left: 0;
width: 100%;
height: 54px;
padding: 10px 16px;
color: #fff;
margin: 0;
z-index: 10;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card h2 span {
display: block;
font-size: 14px;
}
.material-card h2 strong {
display: block;
font-size: 12px;
}
.material-card .mc-description {
position: absolute;
right: .5em;
left: .5em;
bottom: .5em;
overflow: hidden;
opacity: 0;
filter: alpha(opacity=0);
-webkit-transition: all 1.2s;
-moz-transition: all 1.2s;
-ms-transition: all 1.2s;
-o-transition: all 1.2s;
transition: all 1.2s;
text-align: left;
}
.material-card .mc-footer {
height: 0;
overflow: hidden;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card .img-container {
overflow: hidden;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 3;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card.mc-active .mc-description {
top: 30px;
padding-top: 2em;
padding-bottom: 10px;
overflow-y: scroll;
opacity: 1;
filter: alpha(opacity=100);
color: white;
}
.material-card.Profile h2 {
background-color: #000000;
}
.material-card.Profile.mc-active .mc-content {
background-color: #4d4d4d;
}
.material-card.circuit h2 {
background-color: #000000;
}
.material-card.circuit.mc-active .mc-content {
background-color: #4d4d4d;
}
.material-card.mc-active h2 {
top: 0;
padding: 10px 0px 0px 40px;
}
.material-card .mc-content {
position: absolute;
right: 0;
top: 0;
bottom: 0px;
left: 0;
text-align: center;
overflow: hidden;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card .mc-btn-action {
position: absolute;
right: 2px;
top: 2px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
width: 44px;
height: 44px;
text-align: center;
color: #fff;
cursor: pointer;
z-index: 20;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card.mc-active .mc-btn-action {
top: calc(100% - 34px);
}
.material-card.mc-active .img-container {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
width: 54px;
height: 54px;
z-index: 30;
left: 0px;
top: 0px;
}
.material-card.mc-active .mc-description-bottom {
position: flex;
bottom: 0em;
right: 0;
text-align: left;
}
.no-hover:hover {
background-color: transparent;
}
#myInput {
background-color: #000;
width: 60%;
font-size: 16px;
font-family: "D2DTitle2";
color: #fff;
padding: 12px 20px 12px 20px;
border: 1.5px solid #fff;
margin-bottom: 5px;
}
.standings-column {
float: left;
width: 50%;
padding: 15px;
}
.standings-row:after {
content: "";
display: table;
clear: both;
}
.center {
display: block;
margin-left: auto;
margin-right: auto;
width: 190%;
}
#-webkit-keyframes ticker {
0% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
visibility: visible;
}
100% {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
}
#keyframes ticker {
0% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
visibility: visible;
}
100% {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
}
.ticker-wrap {
position: inline-block;
top: 0;
width: 100%;
overflow: hidden;
height: 4rem;
background-color: rgba(0, 0, 0, 0.9);
padding-left: 100%;
}
.ticker {
display: inline-block;
height: 4rem;
line-height: 4rem;
white-space: nowrap;
padding-right: 100%;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-name: ticker;
animation-name: ticker;
-webkit-animation-duration: 30s;
animation-duration: 30s;
}
.ticker_item {
display: inline-block;
padding: 0 2rem;
font-size: 2rem;
color: white;
}
.panel-container {
display: flex;
width: 95%;
}
.panel {
color: white;
cursor: pointer;
flex: content;
margin: .3vw;
position: relative;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
border: .2vw solid #fff;
}
.panel h3 {
font-size: 2vw;
position: absolute;
text-align: center;
bottom: -.01em;
height: 100%;
width: 100%;
writing-mode: vertical-rl;
text-shadow: 0 0 5px black;
position: absolute;
background-color: #4d4d4d;
}
.panel.active {
flex: 22;
}
.panel.active h3 {
writing-mode: horizontal-tb;
margin-left: auto;
margin-right: auto;
width: 100%;
left: 0;
text-align: center;
padding: 0 0;
height: 2.5vw;
transform: rotate(-0deg);
font-size: 2vw;
border-top: .2vw solid #fff;
background-color: black;
}
h1,
h2,
h3,
h7 {
text-transform: uppercase;
text-align: center;
}
h1 {
font-size: 35pt;
color: black;
-webkit-text-stroke-width: 1.3px;
-webkit-text-stroke-color: white;
font-family: 'D2DTitle2', sans-serif;
margin: 1.5rem 0;
}
h2 {
font-size: 18pt;
color: white;
font-family: 'D2DTitle2', sans-serif;
}
h3 {
font-size: 14pt;
color: white;
text-align: center;
font-family: 'D2DTitle2', sans-serif;
}
h4 {
font-size: 11pt;
color: white;
text-align: left;
font-family: 'D2DBody1';
}
h5 {
font-size: 8pt;
font-style: italic;
margin-right: 10px;
color: white;
text-align: right;
font-family: 'D2DBody1';
}
h6 {
font-size: 10pt;
color: white;
text-align: center;
font-family: 'D2DBody1';
}
h7 {
font-size: 12pt;
color: white;
text-align: center;
font-family: 'D2DTitle2', sans-serif;
}
p {
font-size: 12pt;
margin-bottom: 12pt;
}
.container {
max-width: 90%;
margin: 0 auto;
}
.countries-container {
margin-top: 2rem;
margin-bottom: 2rem;
width: 100%;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
}
.countries-container .profile {
position: relative;
width: 18.75em;
margin: 1em 1em 1em 1em;
background-color: #000000;
cursor: pointer;
-webkit-transition: all 0.2s ease-out;
transition: all 0.2s ease-out;
}
.countries-container .circuit {
position: relative;
width: 18.75em;
margin: .75em .75em .75em .75em;
background-color: #000000;
cursor: pointer;
-webkit-transition: all 0.2s ease-out;
transition: all 0.2s ease-out;
}
.material-card {
position: relative;
padding-bottom: calc(100% - 16px);
margin-bottom: 2em;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
border: 2px solid #fff;
}
.material-card h2 {
position: absolute;
top: calc(100% - 2.4em);
left: 0;
width: 100%;
height: 2.4em;
padding: 10px 16px;
color: #fff;
margin: 0;
z-index: 10;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card h2 span {
display: block;
font-size: 0.7em;
}
.material-card h2 strong {
display: block;
font-size: 0.6em;
}
.material-card .mc-description {
position: absolute;
right: .5em;
left: .5em;
bottom: .5em;
overflow: hidden;
opacity: 0;
filter: alpha(opacity=0);
-webkit-transition: all 1.2s;
-moz-transition: all 1.2s;
-ms-transition: all 1.2s;
-o-transition: all 1.2s;
transition: all 1.2s;
}
.material-card .mc-footer {
height: 0;
overflow: hidden;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card .img-container {
overflow: hidden;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 3;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card.mc-active .mc-description {
top: 40px;
padding-top: 2em;
padding-bottom: 2em;
overflow-y: scroll;
opacity: 1;
filter: alpha(opacity=100);
}
.material-card.Profile h2 {
background-color: #000000;
}
.material-card.Profile.mc-active .mc-content {
background-color: #4d4d4d;
}
.material-card.circuit h2 {
background-color: #000000;
}
.material-card.circuit.mc-active .mc-content {
background-color: #4d4d4d;
}
.material-card.mc-active h2 {
top: 0;
padding: 5px 0px 0px 2.5em;
}
.material-card .mc-content {
position: absolute;
right: 0;
top: 0;
bottom: 0px;
left: 0;
text-align: center;
overflow: hidden;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card .mc-btn-action {
position: absolute;
right: 2px;
top: 2px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
width: 54px;
height: 54px;
text-align: center;
color: #fff;
cursor: pointer;
z-index: 20;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card.mc-active .mc-btn-action {
top: calc(100% - 2.6em);
}
.material-card.mc-active .img-container {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
width: 3.6em;
height: 3.6em;
z-index: 30;
left: 0px;
top: 0px;
}
.material-card.mc-active .mc-description-bottom {
position: flex;
bottom: 0;
left: 0;
}
.material-card.mc-active .mc-description {
top: 30px;
padding-top: 2em;
opacity: 1;
filter: alpha(opacity=100);
color: #fff;
}
#myInput {
background-color: #000;
width: 60%;
font-size: 16px;
font-family: "D2DTitle2";
color: #fff;
padding: 12px 20px 12px 20px;
border: 1.5px solid #fff;
margin-bottom: 5px;
}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<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" />
<title>Drive to Describe: News</title>
<meta name="www.drivetodescribe.com" content="News" />
<link rel="stylesheet" href="../style/style.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script async src="https://www.googletagmanager.com/gtag/js?id=G-DXPBR1GF8S"></script>
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
</head>
<body>
<hr style="height:1px;background-color:white">
<h1>News</h1>
</header>
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search On Page..">
<ul id="myUL" class="countries-container container">
</ul>
</div>
</body>
</html>
I have a question about my responsive website.
I deployed my project to web server. In my local server and PC web server, I checked in google chrome dev tool, and z-index worked properly. The menu bar slides from the left side to the right side.
But when I checked in the real browser from a smartphone, the menu field did not show up. Background color and letter color are invisible.
When I tap each a tags (tags are invisible but I guessed each position.), I could jump to each page such as a result page, login page, and homepage. So I guess the menu bar is at the top of the screen.
The question is that,
when I see a responsive website, the menu bar doesn't appear and is
invisible. But a tags inside the menu are working properly so, I
cannot figure out what this problem is coming from.
.logo {
line-height: 50px;
float: left;
text-transform: uppercase;
color: #fff;
}
.header {
height: 50px;
background: #2D2524;
padding: 0 20px;
color: white;
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1000;
}
.header2 {
display: none;
}
.menu {
float: right;
line-height: 50px;
}
.menu a {
color: #fff;
text-transform: uppercase;
text-decoration: none;
padding: 0 10px;
-webkit-transition: 0.4s;
transition: 0.4s;
}
.background-img {
background: url("../LPImages/karina-lago-wEucG_sLRsY-unsplash.jpg");
background-size: 100%;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
width: 100%;
position: relative;
height: 70vh;
}
.main_search {
position: absolute;
top: 70%;
left: 50%;
-webkit-transform: translateY(-50%) translateX(-50%);
transform: translateY(-50%) translateX(-50%);
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 70%;
text-align: center;
}
.search_text {
background: #232323;
opacity: 0.9;
padding-left: 10px;
border: solid 3px #fff;
font-size: 16px;
line-height: 30px;
width: 35%;
height: 3rem;
font-weight: 400;
color: #fff;
}
.search_text:focus {
outline: none;
}
.Genre {
color: #fff;
background: #232323;
opacity: 0.9;
border: solid 3px #fff;
padding-left: 5px;
font-size: 16px;
line-height: 30px;
width: 20%;
height: 3.4rem;
font-weight: 400;
text-transform: uppercase;
}
.Genre:focus {
outline: none;
}
.search_date {
background: #232323;
opacity: 0.8;
margin-right: 15px;
padding-left: 15px;
color: #fff;
border: solid 3px #fff;
font-size: 16px;
width: 20%;
font-weight: 400;
height: 3rem;
}
.search_date:focus {
outline: none;
}
.search_icon {
color: #fff;
}
.show-menu-btn, .hide-menu-btn {
-webkit-transition: 0.4s;
transition: 0.4s;
font-size: 20px;
cursor: pointer;
display: none;
}
.show-menu-btn {
float: right;
}
.show-menu-btn i {
line-height: 50px;
}
.menu a:hover,
.show-menu-btn:hover,
.hide-menu-btn:hover {
color: grey;
}
.paragrah {
height: 50%;
width: 30%;
color: white;
margin-left: 5em;
margin-top: 7em;
margin-bottom: 20em;
font-size: 20px;
background-color: rgba(0, 0, 0, 0.7);
text-align: justify;
}
#chk {
position: absolute;
visibility: hidden;
z-index: -1111;
}
/*.content {
padding: o 20px;
img {
width: 100%;
max-width: 700px;
margin: 20px 0;
}
}*/
#media screen and (max-width: 800px) {
.header {
display: none;
}
.search {
display: none;
}
.header2 {
display: block;
width: 100%;
max-width: 100%;
-webkit-box-shadow: none;
box-shadow: none;
position: fixed;
height: 50px;
background: #2D2524;
overflow: hidden;
z-index: 10;
}
.background-img {
width: 100%;
}
.main {
margin: 0 auto;
display: block;
height: 100%;
margin-top: 60px;
}
.mainInner {
display: table;
height: 100%;
width: 100%;
text-align: center;
}
.mainInner div {
display: table-cell;
vertical-align: middle;
font-size: 3em;
font-weight: bold;
letter-spacing: 1.25px;
}
#sidebarSearch {
position: relative;
height: 100%;
left: 0;
width: 100%;
margin-top: 50px;
-webkit-transform: translateX(1500px);
transform: translateX(1500px);
-webkit-transition: -webkit-transform 0.6s ease-in-out;
transition: -webkit-transform 0.6s ease-in-out;
transition: transform 0.6s ease-in-out;
transition: transform 0.6s ease-in-out, -webkit-transform 0.6s ease-in-out;
background: #000000;
color: #fff;
position: fixed;
text-align: center;
}
.sidebarIconSearch i {
color: #fff;
-webkit-transition: all 0.3s;
transition: all 0.3s;
-webkit-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
position: absolute;
top: 16px;
right: 25px;
z-index: 99;
font-size: 20px;
}
input[type="checkbox"]:checked ~ #sidebarSearch {
-webkit-transform: translateX(0);
transform: translateX(0);
}
input[type="checkbox"]:checked ~ #sidebarSearch ~ .sidebarIconToggle {
display: none;
}
.openSidebarSearch {
float: right;
}
.search-title {
font-size: 20px;
font-weight: bold;
margin: 20px 0 10px;
}
.search_text {
outline: none;
height: 30px;
width: 60%;
border: solid 3px #fff;
background: none;
border-radius: 30px;
color: #fff;
padding: 0 20px;
font-size: 16px;
}
.tag-list {
color: #000000;
margin: 0;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
list-style: none;
padding: 10px;
}
.tag-list li {
background: #fff;
border-radius: 30px;
margin: 4px;
height: 24px;
width: 80px;
-ms-flex-pack: distribute;
justify-content: space-around;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
font-size: 12px;
}
.Category dt {
background: #fff;
width: 80px;
height: 80px;
border-radius: 50%;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.Category dt img {
width: 50px;
height: 50px;
}
.Category dd {
text-transform: uppercase;
font-weight: bold;
margin: 0 auto;
}
.Category-list {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: space-evenly;
-ms-flex-pack: space-evenly;
justify-content: space-evenly;
}
.Day-box {
outline: none;
height: 30px;
width: 200px;
border: solid 3px #fff;
background: none;
border-radius: 30px;
color: #fff;
padding: 0 20px;
font-size: 16px;
}
#sidebarMenu {
position: relative;
width: 100%;
height: 100%;
position: fixed;
left: 0;
margin-top: 50px;
-webkit-transform: translateX(-1500px);
transform: translateX(-1500px);
-webkit-transition: -webkit-transform 0.6s ease-in-out;
transition: -webkit-transform 0.6s ease-in-out;
transition: transform 0.6s ease-in-out;
transition: transform 0.6s ease-in-out, -webkit-transform 0.6s ease-in-out;
background: #000000;
}
.sidebarMenuInner {
position: absolute;
text-align: center;
top: 40%;
left: 50%;
-webkit-transform: translateY(-50%) translateX(-50%);
transform: translateY(-50%) translateX(-50%);
margin: 0;
padding: 0;
}
.sidebarMenuInner li {
list-style: none;
color: #fff;
text-transform: uppercase;
font-weight: bold;
font-size: 20px;
padding: 30px;
cursor: pointer;
}
.sidebarMenuInner li a {
color: #fff;
text-transform: uppercase;
font-weight: bold;
cursor: pointer;
text-decoration: none;
}
input[type="checkbox"]:checked ~ #sidebarMenu {
-webkit-transform: translateX(0);
transform: translateX(0);
}
input[type="checkbox"]:checked ~ #sidebarMenu ~ .sidebarIconSearch {
display: none;
}
input[type="checkbox"]:checked ~ #sidebarMenu ~ #sidebarSearch {
display: none;
}
input[type=checkbox] {
-webkit-transition: all 0.3s;
transition: all 0.3s;
-webkit-box-sizing: border-box;
box-sizing: border-box;
display: none;
}
.sidebarIconToggle {
-webkit-transition: all 0.3s;
transition: all 0.3s;
-webkit-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
position: absolute;
z-index: 99;
height: 100%;
width: 100%;
top: 18px;
left: 20px;
height: 22px;
width: 22px;
}
.spinner {
-webkit-transition: all 0.3s;
transition: all 0.3s;
-webkit-box-sizing: border-box;
box-sizing: border-box;
position: absolute;
height: 3px;
width: 100%;
background-color: #fff;
}
.horizontal {
-webkit-transition: all 0.3s;
transition: all 0.3s;
-webkit-box-sizing: border-box;
box-sizing: border-box;
position: relative;
float: left;
margin-top: 3px;
}
.diagonal.part-1 {
position: relative;
-webkit-transition: all 0.3s;
transition: all 0.3s;
-webkit-box-sizing: border-box;
box-sizing: border-box;
float: left;
}
.diagonal.part-2 {
-webkit-transition: all 0.3s;
transition: all 0.3s;
-webkit-box-sizing: border-box;
box-sizing: border-box;
position: relative;
float: left;
margin-top: 3px;
}
input[type=checkbox]:checked ~ .sidebarIconToggle > .horizontal {
-webkit-transition: all 0.3s;
transition: all 0.3s;
-webkit-box-sizing: border-box;
box-sizing: border-box;
opacity: 0;
}
input[type=checkbox]:checked ~ .sidebarIconToggle > .diagonal.part-1 {
-webkit-transition: all 0.3s;
transition: all 0.3s;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-transform: rotate(135deg);
transform: rotate(135deg);
margin-top: 8px;
}
input[type=checkbox]:checked ~ .sidebarIconToggle > .diagonal.part-2 {
-webkit-transition: all 0.3s;
transition: all 0.3s;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-transform: rotate(-135deg);
transform: rotate(-135deg);
margin-top: -9px;
}
}
.image img {
border: 1px solid white;
}
.event-name {
font-size: 20px;
color: white;
}
.heart {
margin-top: -20px;
margin-left: 17rem;
}
.event-date {
font-size: 20px;
color: #FD8700;
}
.card-info {
color: white;
font-size: 18px;
}
.save-mark {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.button {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 300px;
margin-left: 120px;
}
.seemore-btn {
margin-top: 4rem;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.seemore-btn a {
color: white;
border-radius: 30px;
font-size: 24px;
padding: 4px 20px 4px 20px;
border: 0;
cursor: pointer;
text-decoration: none;
background: #7206F7;
}
.category-container {
margin-top: 8rem;
}
.category-card {
padding: 0 50px 80px;
margin: 0 auto;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
text-align: center;
-webkit-box-pack: space-evenly;
-ms-flex-pack: space-evenly;
justify-content: space-evenly;
}
.category-card p {
text-transform: uppercase;
margin-top: 20px;
color: #ffffff;
font-size: 35px;
}
.category-image {
overflow: hidden;
border-radius: 50%;
width: 220px;
height: 220px;
border: solid #ffffff 1px;
}
.category-image img {
width: 220px;
height: 220px;
-o-object-fit: cover;
object-fit: cover;
border-radius: 50%;
-webkit-transition-duration: 0.5s;
transition-duration: 0.5s;
-webkit-transform: scale(1);
transform: scale(1);
}
.category-image img:hover {
-webkit-transform: scale(1.1, 1.1);
transform: scale(1.1, 1.1);
}
#media screen and (max-width: 800px) {
.category-card {
display: block;
}
.category-card-content {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-bottom: 70px;
position: relative;
}
.category-card-content p {
position: absolute;
top: 43%;
left: 50%;
-webkit-transform: translateY(-50%) translateX(-50%);
transform: translateY(-50%) translateX(-50%);
font-size: 45px;
}
.category-image {
margin: 0 auto;
border: solid 1px #ffffff;
}
.category-image img {
opacity: 0.7;
}
}
.use_contents {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.use_contents img {
margin-right: 7rem;
width: 20%;
}
.Description {
text-align: center;
width: 30%;
}
.Description p {
text-align: center;
font-size: 19px;
margin-top: 0.5rem;
color: #c7c7c7;
}
.register-btn {
margin-top: 4rem;
}
.register-btn a {
background-color: #F70661;
text-decoration: none;
color: white;
margin-top: 10px;
border-radius: 30px;
font-size: 24px;
padding: 4px 20px 4px 20px;
border: 0;
cursor: pointer;
}
.find_func {
margin: 1rem;
}
.use_contents2 img {
margin-left: 7rem;
margin-right: 0;
}
.start {
margin: 4rem 0 10rem;
text-align: center;
}
.right {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin: 0 0 0 auto;
}
#media screen and (max-width: 800px) {
.use_contents {
padding: 20px;
}
.use_contents img {
margin-right: 1rem;
width: 40%;
}
.use_contents2 {
margin-left: 0;
}
.use_contents2 img {
margin-right: 0;
margin-left: 1rem;
}
.Description {
width: 100%;
}
h4 {
margin: 0;
}
}
.login {
background: url("../LPImages/danny-howe-bn-D2bCvpik-unsplash.jpg");
background-size: 100%;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
width: 100%;
position: relative;
height: 80vh;
}
.login-contents {
background: rgba(0, 0, 0, 0.4);
height: 80vh;
width: 100%;
text-align: center;
}
.login-base {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translateY(-50%) translateX(-50%);
transform: translateY(-50%) translateX(-50%);
}
.login-base h2 {
margin: 0;
}
.login-erea p {
font-size: 18px;
color: white;
}
.login-box {
margin: 12px 0;
padding: 0 20px;
font-size: 12px;
color: #fff;
background: none;
border-radius: 30px;
height: 2.3em;
width: 25em;
outline: none;
border: #fff solid 3px;
}
.login-link {
margin-top: 2.5rem;
}
.login-link a {
background-color: #0FCC41;
color: white;
margin-top: 10px;
border-radius: 30px;
font-size: 24px;
padding: 4px 38px 4px 38px;
border: 0;
cursor: pointer;
text-decoration: none;
}
.forgot {
margin-top: 0.8rem;
}
.forgot a {
font-size: 18px;
color: white;
text-decoration: none;
border-bottom: 0.5px solid white;
}
.sns-icon-erea {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
margin: 2rem 0 0.5rem;
}
.sns-icon {
position: relative;
height: 50px;
width: 50px;
border-radius: 50%;
margin: 0 10px;
cursor: pointer;
}
.sns-icon i {
color: #fff;
position: absolute;
top: 50%;
left: 52%;
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}
.footer {
height: 50vh;
width: 100%;
background-color: #2D2524;
}
/*#import "./footer";*/
* {
margin: 0;
padding: 0;
font-family: 'Josefin Sans', sans-serif;
font-weight: 100;
}
body {
background-color: black;
}
h2 {
color: white;
text-align: center;
margin-bottom: 3rem;
font-size: 38px;
}
h3 {
color: white;
font-size: 33px;
}
h4 {
color: white;
font-size: 23px;
margin-top: 2rem;
}
.face {
background: #305097;
}
.twi {
background: #00aced;
}
.goo {
background: #db4a39;
}
/*# sourceMappingURL=main.css.map */
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet">
<link rel="stylesheet" href="../css/main.css">
<link rel="stylesheet" href="https://unpkg.com/swiper/css/swiper.css">
<link rel="stylesheet" href="../css/swiper.css">
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap" rel="stylesheet">
<title>landing page</title>
</head>
<body>
<div class="header">
<h1 class="logo">Dark Code</h1>
<input type="checkbox" id="chk">
<label for="chk" class="show-menu-btn">
<i class="fas fa-bars" style="color: white;"></i>
</label>
<ul class="menu">
<div class="menu-list">
Register
Events
Login
<label for="chk" class="hide-menu-btn">
<i class="fas fa-times" style="color: white;"></i>
</label>
</div>
</ul>
</div>
<div class="header2">
<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 id="sidebarMenu">
<ul class="sidebarMenuInner">
<li>Home</li>
<li>Events</li>
<li>Profile</li>
<li>Log out</li>
</ul>
</div>
<input type="checkbox" class="openSidebarSearch" id="openSidebarSearch">
<label for="openSidebarSearch" class="sidebarIconSearch">
<i class="fas fa-search search_icon"></i>
</label>
<div id="sidebarSearch">
<div class="search-erea">
<div class="search-title">Enter the name of event</div>
<input type="text" class="search_text">
<div class="search-title">Choose tags</div>
<ul class="tag-list">
<li>Tag</li>
<li>Tag</li>
<li>Tag</li>
<li>Tag</li>
</ul>
<ul class="tag-list">
<li>Tag</li>
<li>Tag</li>
<li>Tag</li>
<li>Tag</li>
</ul>
</div>
<div class="search-erea">
<div class="search-title">Categorys</div>
<div class="Category-list">
<dl class="Category">
<dt><img src="./image/martini.png" alt="bar-img"></dt>
<dd>bar</dd>
</dl>
<dl class="Category">
<dt><img src="./image/beer.png" alt="pub-img"></dt>
<dd>pub</dd>
</dl>
<dl class="Category">
<dt><img src="./image/dj.png" alt="club-img"></dt>
<dd>club</dd>
</dl>
</div>
</div>
<div class="search-erea">
<div class="search-title">Day</div>
<input type="text" class="Day-box">
</div>
</div>
</div>
<div class="background-img">
<div class="main_search">
<div class="search_content">
<form action="#" class="search">
<input type="text" class="search_text" placeholder="Enter the key words !">
<select name="select" id="select" class="Genre">
<option value="" hidden">genre</option>
<option value="1">bar</option>
<option value="2">pub</option>
<option value="3">club</option>
</select>
<input type="date" class="search_date">
<i class="fas fa-search search_icon"></i>
</div>
</div>
</div>
<script src="https://unpkg.com/swiper/js/swiper.js"></script>
<script src="https://unpkg.com/swiper/js/swiper.min.js"></script>
<script src="./js/swiper.min.js"></script>
<script>
var mySwiper = new Swiper ('.swiper-container', {
// Optional parameters
direction: 'horizontal',
slidesPerView: 4,
spaceBetween: 10,
centeredSlides : true,
loop: true,
// Navigation arrows
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
})
</script>
</body>
</html>
From a smartphone, it doesn't work, but if you check from PC, it works so I hope you can check this link from a smartphone.
thank you.
I checked both iOS and Android chrome browser.
And this issue is happening only in iOS.
So please check by iPhone.
I also experience this issue on iOS devices time to time.
z-index behaves different on iOS (no matter the browser). Even if you correctly index content on Z axis, it won't be shown correctly on iOS devices.
Workaround is, giving container div a higher z-index than background.
In your case #sidebarMenu {z-index: 100;} should work.
This looks like it might be an issue with iOS.
According to the specs, the CSS property z-index should only not work if an element has the default positioning:
position: static
Consequently, to ensure that z-index works, any of the following may be applied to the element (which we can see you're already doing):
position: relative
position: absolute
position: fixed
position: sticky
Further Reading:
position: static
The element is positioned according to the normal flow of the document. The top, right, bottom, left, and z-index properties have no
effect. This is the default value.
Source: https://developer.mozilla.org/en-US/docs/Web/CSS/position#values
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;
}
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>