Z-index issue using transform scale - css

I have a codepen below. Basically, I'm trying to show a popup on hover of the highlighted circles (red), however some highlighted circles are showing up above some of the popups, even when the popups are always given a higher z-index all the time.
http://codepen.io/Wolfmans55/pen/jPwKqZ
This is the animation used for the popup, which I believe maybe the culprit.
#-webkit-keyframes popup {
0% {
transform: scale(2.5);
}
100% {
transform: scale(0);
}
}

Take out the z-index setting on .white-popup and set a higher z-index on .white-popup:hover .popup and .white:hover.
see jsfiddle
#import url(http://fonts.googleapis.com/css?family=Roboto);
body,
html {
height: 100%;
}
body {
background: #343837;
transition: opacity .25s;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
overflow: hidden;
}
.show-body {
opacity: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
}
.page {
background: #343837;
font-family: 'Roboto', sans-serif;
font-size: 100%;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
transition: all 1s;
}
.page-2 {
left: auto;
right: -100%;
background: blue;
}
.prev-page,
.next-page {
position: absolute;
top: 50%;
width: 50px;
height: 50px;
background: red;
}
.next-page {
right: 20px;
}
.prev-page {
left: 20px;
}
.page-wrapper {
position: absolute;
top: 50%;
margin-top: -303px;
width: 100%;
}
.header_section {
text-shadow: 1px 1px 1px #000;
font-size: 2em;
}
h1 {
margin: 0;
}
.blue_title {
color: #54c8e7;
font-weight: normal;
}
.primary_title {
font-size: 4em;
margin-top: -34px;
margin-bottom: 20px;
}
.sub_title {
position: relative;
font-size: 1em;
background: #343837;
padding: 0 4px;
display: inline-block;
}
.sub_title_divider {
border-top: 1px solid #54c8e7;;
position: absolute;
top: 20px;
left: 0;
width: 100%;
}
.city-name {
font-size: 2em;
}
.emphasis {
font-weight: bold;
}
.inlineblock {
display: inline-block;
}
.centertxt {
text-align: center;
}
.pos_rel {
position: relative;
}
.overflow_hidden {
overflow: hidden;
}
.vert_mid {
vertical-align: middle;
}
table {
cursor: pointer;
margin: 0 auto;
border-spacing: 1px;
}
td {
width: 10px;
height: 10px;
border-radius: 50%;
}
.white,
.white-popup {
background: #000;
position: relative;
-webkit-animation: in .25s;
}
.white-popup {
background: red;
}
/*.plan-to {
background: #018c9e;
z-index: 2;
}*/
.white-popup .popup {
cursor: auto;
-webkit-animation: popup .25s forwards;
z-index: 10;
}
.popup {
position: absolute;
width: 100px;
height: 100px;
font-size: 5px;
overflow: hidden;
background: #54c8e7;
z-index:10;
top: -45px;
left: -45px;
padding: 8px;
border: 1px solid #343837;
border-radius: 3px;
box-sizing: border-box;
}
.white-popup:hover .popup {
-webkit-animation: out .25s forwards;
z-index: 50;
}
.white:hover {
-webkit-animation: out .25s forwards;
z-index: 50;
}
#-webkit-keyframes in {
from {background:#fff; transform: scale(1);}
to {background: #54c8e7; transform: scale(2.5);}
}
#-webkit-keyframes out {
0% {background:#fff; transform: scale(1);}
100% {background: #54c8e7; transform: scale(2.5);}
}
#-webkit-keyframes popup {
0% {
transform: scale(2.5);
}
100% {
transform: scale(0);
}
}
.key {
height: 15px;
width: 15px;
border-radius: 50%;
border: 1px solid #ccc;
margin-right: 2px;
}
.key_1 {
background: #54c8e7;
}
.key_2 {
background: #018c9e;
}
.key_3 {
background: #fff;
}
.legend {
text-transform:uppercase;
font-size: 12px;
color: #fff;
margin-bottom: 30px;
}
.legend_item {
margin-left: 15px;
}
#media screen and (min-width: 768px) {
.page-wrapper {
margin-top: -388px;
}
td {
width: 15px;
height: 15px;
}
}

I added the following CSS:
td:hover {
z-index: 1;
}
And inside .white-popup selector, I removed:
z-index: 2;
line.
Seems to work for me.

Related

Setting A Hamburger Menu So That It Stretches Across The Entire Screen

Below is the code that I've used to create a responsive hamburger menu. I'd like to set the hamburger menu so that when opened it stretches (and is displayed) across the entire screen. I imagine that this would involve editing the CSS, which I have unsuccessfully tried doing.
If anyone has any ideas on how I could have the hamburger menu displayed across the entire screen, I'd appreciate you sharing your knowledge with me. Thank you.
.body {
background-color: white;
font-family: sans-serif;
}
.searchbar {
float: right;
}
.image {
text-align: center;
}
.setsumei {
margin-left: 20px;
margin-right: 20px;
}
.footer {
width: 100%;
height: 40px;
text-align: center;
border-top: 1px solid black;
position: absolute;
bottom: 0;
padding: 10px;
}
.page-wrap {
min-height: 100%;
margin-bottom: -40px;
}
.page-wrap:after {
content: "";
display: block;
}
.site-footer,
.page-wrap:after {
height: 20px;
}
.site-footer {
text-align: center;
border-top: 1px solid black;
padding: 10px;
}
*,
*:before,
*:after {
padding-left: 0;
margin: 0;
box-sizing: border-box;
}
ol,
ul {
list-style: none;
}
a {
text-decoration: none;
color: black;
}
.cp_cont {
height: auto;
}
/* menu */
.cp_offcm03 {
position: relative;
z-index: 5000;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: auto;
width: 100%;
height: auto;
padding-top: 0;
-webkit-transition: transform 0.3s ease-in;
transition: transform 0.3s ease-in;
text-align: center;
color: black;
background-color: white;
}
.cp_offcm03 nav,
.cp_offcm03 ul {
height: 100%;
}
.cp_offcm03 li {
display: inline-block;
margin-right: -6px;
}
.cp_offcm03 a {
display: block;
padding: 15px 45px;
margin-bottom: -5px;
-webkit-transition: background-color .3s ease-in;
transition: background-color .3s ease-in;
}
.cp_offcm03 a:hover {
background-color: lightgray;
}
/* menu toggle */
#cp_toggle03 {
display: none;
}
#cp_toggle03:checked~.cp_offcm03 {
-webkit-transform: translateX(0);
transform: translateX(0);
}
#cp_toggle03:checked~.cp_container {
-webkit-transform: translateX(0);
transform: translateX(0);
}
.cp_mobilebar {
display: none;
}
/* content */
.cp_container {
position: relative;
top: 0;
padding: 35px auto;
-webkit-transition: transform .3s ease-in;
transition: transform .3s ease-in;
}
.cp_content {
margin: 0 auto;
padding: 20px;
height: 65vh;
text-align: center;
}
#media (max-width: 1130px)and (min-width: 280px) {
/* menu */
.cp_offcm03 {
position: fixed;
left: -250px;
overflow-y: hidden;
width: 250px;
height: 100%;
padding-top: 40px;
color: black;
background-color: white;
z-index: 1000;
}
.cp_offcm03 nav {
background: white;
border-right: 0.5px solid lightgray;
margin-left: -210px;
}
.cp_offcm03 li {
display: block;
margin-right: 0;
}
.cp_offcm03 a {
padding: 20px;
}
/* menu toggle */
.cp_mobilebar {
display: block;
z-index: 2000;
position: relative;
top: 0;
left: 0;
padding: 0 25px;
width: 100%;
height: 40px;
background-color: white;
border-bottom: .05px solid lightgray;
}
.cp_menuicon {
display: block;
position: relative;
width: 25px;
height: 100%;
cursor: pointer;
-webkit-transition: transform .3s ease-in;
transition: transform .3s ease-in;
}
.cp_menuicon>span {
display: block;
position: absolute;
top: 55%;
margin-top: -0.3em;
width: 100%;
height: 0.2em;
border-radius: 1px;
background-color: black;
-webkit-transition: transform .3s ease;
transition: transform .3s ease;
}
.cp_menuicon>span:before,
.cp_menuicon>span:after {
content: "";
position: absolute;
width: 100%;
height: 100%;
border-radius: 1px;
background-color: black;
-webkit-transition: transform .3s ease-in;
transition: transform .3s ease-in;
}
.cp_menuicon>span:before {
-webkit-transform: translateY(-0.6em);
transform: translateY(-0.6em);
}
.cp_menuicon>span:after {
-webkit-transform: translateY(0.6em);
transform: translateY(0.6em);
}
#cp_toggle03:checked+.cp_mobilebar .cp_menuicon {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
#cp_toggle03:checked+.cp_mobilebar span:before,
#cp_toggle03:checked+.cp_mobilebar span:after {
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
#cp_toggle03:checked~.cp_offcm03 {
-webkit-transform: translateX(100%);
transform: translateX(100%);
}
#cp_toggle03:checked~.cp_container {
-webkit-transform: translateX(250px);
transform: translateX(250px);
}
input:checked~#h-menu_black {
display: block;
opacity: .6;
}
#h-menu_black {
display: none;
position: fixed;
z-index: 999;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: black;
opacity: 0;
transition: .7s ease-in-out;
}
/* content */
.cp_container {
top: 60px;
height: 92vh;
text-align: center;
}
.noscroll {
overflow: hidden;
position: fixed;
}
}
<div class="cp_cont">
<input id="cp_toggle03" type="checkbox" />
<div class="cp_mobilebar">
<label for="cp_toggle03" class="cp_menuicon">
<span></span>
</label>
</div>
<label id="h-menu_black" class="cp_toggle03" for="cp_menuicon"></label>
<div id="body" class="noscroll"></div>
<header class="cp_offcm03">
<nav>
<ul style="text-align: center; margin-left: 210px; overflow: hidden">
<li style="border-bottom: 1px solid lightgray">Home</li>
<li style="border-bottom: 1px solid lightgray">Blog</li>
<li style="border-bottom: 1px solid lightgray">About This Website</li>
<li style="border-bottom: 1px solid lightgray">Bibliography</li>
</ul>
</nav>
</header>
</div>
It's just a matter of adjusting the menu width and the translation dimension to match. Look into how you can use your browser's document inspector to find styles relevant to your goals.
FYI, you don't need vendor prefixes for transform or transition.
/* Scroll down... */
.body {
background-color: white;
font-family: sans-serif;
}
.searchbar {
float: right;
}
.image {
text-align: center;
}
.setsumei {
margin-left: 20px;
margin-right: 20px;
}
.footer {
width: 100%;
height: 40px;
text-align: center;
border-top: 1px solid black;
position: absolute;
bottom: 0;
padding: 10px;
}
.page-wrap {
min-height: 100%;
margin-bottom: -40px;
}
.page-wrap:after {
content: "";
display: block;
}
.site-footer,
.page-wrap:after {
height: 20px;
}
.site-footer {
text-align: center;
border-top: 1px solid black;
padding: 10px;
}
*,
*:before,
*:after {
padding-left: 0;
margin: 0;
box-sizing: border-box;
}
ol,
ul {
list-style: none;
}
a {
text-decoration: none;
color: black;
}
.cp_cont {
height: auto;
}
/* menu */
.cp_offcm03 {
position: relative;
z-index: 5000;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: auto;
width: 100%;
height: auto;
padding-top: 0;
transition: transform 0.3s ease-in;
text-align: center;
color: black;
background-color: white;
}
.cp_offcm03 nav,
.cp_offcm03 ul {
height: 100%;
}
.cp_offcm03 li {
display: inline-block;
margin-right: -6px;
}
.cp_offcm03 a {
display: block;
padding: 15px 45px;
margin-bottom: -5px;
transition: background-color .3s ease-in;
}
.cp_offcm03 a:hover {
background-color: lightgray;
}
/* menu toggle */
#cp_toggle03 {
display: none;
}
#cp_toggle03:checked~.cp_offcm03 {
transform: translateX(0);
}
#cp_toggle03:checked~.cp_container {
transform: translateX(0);
}
.cp_mobilebar {
display: none;
}
/* content */
.cp_container {
position: relative;
top: 0;
padding: 35px auto;
transition: transform .3s ease-in;
}
.cp_content {
margin: 0 auto;
padding: 20px;
height: 65vh;
text-align: center;
}
#media (max-width: 1130px)and (min-width: 280px) {
/* menu */
.cp_offcm03 {
position: fixed;
left: -100vw; /* <------------------------------------------------ HERE */
overflow-y: hidden;
width: 100vw; /* <------------------------------------------------ HERE */
height: 100%;
padding-top: 40px;
color: black;
background-color: white;
z-index: 1000;
}
.cp_offcm03 nav {
background: white;
border-right: 0.5px solid lightgray;
margin-left: -210px;
}
.cp_offcm03 li {
display: block;
margin-right: 0;
}
.cp_offcm03 a {
padding: 20px;
}
/* menu toggle */
.cp_mobilebar {
display: block;
z-index: 2000;
position: relative;
top: 0;
left: 0;
padding: 0 25px;
width: 100%;
height: 40px;
background-color: white;
border-bottom: .05px solid lightgray;
}
.cp_menuicon {
display: block;
position: relative;
width: 25px;
height: 100%;
cursor: pointer;
-webkit-transition: transform .3s ease-in;
transition: transform .3s ease-in;
}
.cp_menuicon>span {
display: block;
position: absolute;
top: 55%;
margin-top: -0.3em;
width: 100%;
height: 0.2em;
border-radius: 1px;
background-color: black;
-webkit-transition: transform .3s ease;
transition: transform .3s ease;
}
.cp_menuicon>span:before,
.cp_menuicon>span:after {
content: "";
position: absolute;
width: 100%;
height: 100%;
border-radius: 1px;
background-color: black;
-webkit-transition: transform .3s ease-in;
transition: transform .3s ease-in;
}
.cp_menuicon>span:before {
-webkit-transform: translateY(-0.6em);
transform: translateY(-0.6em);
}
.cp_menuicon>span:after {
-webkit-transform: translateY(0.6em);
transform: translateY(0.6em);
}
#cp_toggle03:checked+.cp_mobilebar .cp_menuicon {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
#cp_toggle03:checked+.cp_mobilebar span:before,
#cp_toggle03:checked+.cp_mobilebar span:after {
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
#cp_toggle03:checked~.cp_offcm03 {
-webkit-transform: translateX(100%);
transform: translateX(100%);
}
#cp_toggle03:checked~.cp_container {
-webkit-transform: translateX(250px);
transform: translateX(250px);
}
input:checked~#h-menu_black {
display: block;
opacity: .6;
}
#h-menu_black {
display: none;
position: fixed;
z-index: 999;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: black;
opacity: 0;
transition: .7s ease-in-out;
}
/* content */
.cp_container {
top: 60px;
height: 92vh;
text-align: center;
}
.noscroll {
overflow: hidden;
position: fixed;
}
}
<div class="cp_cont">
<input id="cp_toggle03" type="checkbox">
<div class="cp_mobilebar">
<label for="cp_toggle03" class="cp_menuicon">
<span></span>
</label>
</div>
<label id="h-menu_black" class="cp_toggle03" for="cp_menuicon"></label>
<div id="body" class="noscroll"></div>
<header class="cp_offcm03">
<nav>
<ul style="text-align: center; margin-left: 210px; overflow: hidden;">
<li style="border-bottom: 1px solid lightgray;">Home</li>
<li style="border-bottom: 1px solid lightgray;">Blog</li>
<li style="border-bottom: 1px solid lightgray;">About This Website</li>
<li style="border-bottom: 1px solid lightgray;">Bibliography</li>

CSS transition not smooth for one element on hover, but is smooth when mouse moved away

I've got the following CSS and HTML. The problem is, that when the mouse is moved over the button, the red rectangle flashes to the center instead of smoothly moving to the center. It is strange because when the mouse is moved away from the button, it moves back slowly. How can I make the red rectangle move to the center smooth?
.btn {
position: relative;
display: inline-block;
padding: 30px 45px;
margin: 80px;
cursor: pointer;
}
.btn .rect {
transition: all 0.5s linear;
height: 100%;
width: 100%;
opacity: 0.3;
position: absolute;
}
.btn .top-left {
top: -10px;
left: -10px;
}
.btn .bottom-right {
bottom: -10px;
right: -10px;
}
.red-translucent {
background-color: red;
}
.blue-translucent {
background-color: blue;
}
.btn-text {
z-index: 99999;
position: relative;
font-family: Arial;
}
.btn:hover .rect {
top: 0;
bottom: 0;
left: 0;
right: 0;
}
<div class='btn'>
<span class='btn-text'>button</span>
<div class='rect top-left blue-translucent'></div>
<div class='rect bottom-right red-translucent'></div>
</div>
For some reason, it didn't work with bottom: -10px and right: -10px. I'm not sure if this has to do with my code or if this is a browser problem, but the easy fix is to use the top and left properties instead:
.btn {
position: relative;
display: inline-block;
padding: 30px 45px;
margin: 80px;
cursor: pointer;
}
.btn .rect {
transition: all 0.5s linear;
height: 100%;
width: 100%;
opacity: 0.3;
position: absolute;
}
.btn .top-left {
top: -10px;
left: -10px;
}
.btn .bottom-right {
top: 10px;
left: 10px;
}
.red-translucent {
background-color: red;
}
.blue-translucent {
background-color: blue;
}
.btn-text {
z-index: 99999;
position: relative;
font-family: Arial;
}
.btn:hover .rect {
top: 0;
bottom: 0;
left: 0;
right: 0;
}
<div class='btn'>
<span class='btn-text'>button</span>
<div class='rect top-left blue-translucent'></div>
<div class='rect bottom-right red-translucent'></div>
</div>
.red-translucent {
background-color: red;
top: 10px;
left: 10px;
}
Use transform instead of top, left, bottom, right like this:
.btn {
position: relative;
display: flex;
padding: 30px 45px;
margin: 80px;
cursor: pointer;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
}
.btn .rect {
transition: all 0.5s linear;
height: 100%;
width: 100%;
opacity: 0.3;
position: absolute;
}
.btn .top-left {
transform: translate(-10px, -10px);
}
.btn .bottom-right {
transform: translate(10px, 10px);
}
.red-translucent {
background-color: red;
}
.blue-translucent {
background-color: blue;
}
.btn-text {
z-index: 99999;
position: relative;
font-family: Arial;
}
.btn:hover .rect {
transform: translate(0px, 0px);
}
This will work smoothly on either the move-in or move-out of the pointer.

how to make owl carousel appear in all the pages of the blog

im really new at this but made owl carousel appear at the main page of my blog just the way i like it.
the thing is, now i want it to appear the same way in all the pages of the blog. is there a way i can make the call in the pages or anything i can add to the theme or main page so it can show it in all the articles?
i have it in the html of the theme like this
* ######## Top Feature Css ######################### */
.recent-boxes .carousel {
position: relative;
margin: 0 0 0!important;
padding: 0;
overflow: visible;
height: auto;
display: block;
clear: both
}
.owl-carousel .animated {
-webkit-animation-duration: 1000ms;
animation-duration: 1000ms;
-webkit-animation-fill-mode: both;
animation-fill-mode: both
}
.owl-carousel .owl-animated-in {
z-index: 0
}
.owl-carousel .owl-animated-out {
z-index: 1
}
.owl-carousel .fadeOut {
-webkit-animation-name: fadeOut;
animation-name: fadeOut
}
#-webkit-keyframes fadeOut {
0% {
opacity: 1
}
100% {
opacity: 0
}
}
#keyframes fadeOut {
0% {
opacity: 1
}
100% {
opacity: 0
}
}
.owl-height {
-webkit-transition: height 500ms ease-in-out;
-moz-transition: height 500ms ease-in-out;
-ms-transition: height 500ms ease-in-out;
-o-transition: height 500ms ease-in-out;
transition: height 500ms ease-in-out
}
.owl-carousel {
display: none;
width: 100%;
-webkit-tap-highlight-color: transparent;
position: relative;
z-index: 1
}
.owl-carousel .owl-stage {
position: relative;
-ms-touch-action: pan-Y
}
.owl-carousel .owl-stage:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0
}
.owl-carousel .owl-stage-outer {
position: relative;
overflow: hidden;
-webkit-transform: translate3d(0px, 0px, 0px)
}
.owl-carousel .owl-controls .owl-nav .owl-prev,
.owl-carousel .owl-controls .owl-nav .owl-next,
.owl-carousel .owl-controls .owl-dot {
cursor: pointer;
cursor: hand;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none
}
.owl-carousel.owl-loaded {
display: block
}
.owl-carousel.owl-loading {
opacity: 0;
display: block
}
.owl-carousel.owl-hidden {
opacity: 0
}
.owl-carousel .owl-refresh .owl-item {
display: none
}
.owl-carousel .owl-item {
position: relative;
min-height: 1px;
float: left;
-webkit-backface-visibility: hidden;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none
}
.owl-carousel .owl-item img {
display: block;
width: 100%;
-webkit-transform-style: preserve-3d
}
.owl-carousel.owl-text-select-on .owl-item {
-webkit-user-select: auto;
-moz-user-select: auto;
-ms-user-select: auto;
user-select: auto
}
.owl-carousel .owl-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -o-grab;
cursor: -ms-grab;
cursor: grab
}
.owl-carousel.owl-rtl {
direction: rtl
}
.owl-carousel.owl-rtl .owl-item {
float: right
}
.no-js .owl-carousel {
display: block
}
.owl-prev,
.owl-next {
top: 0;
color: #fff;
background-color: rgba(0, 0, 0, 0.75);
font-family: FontAwesome;
position: absolute;
z-index: 1;
display: block;
padding: 0;
cursor: pointer;
padding: 0;
text-align: center;
overflow: hidden
}
.owl-prev {
left: 0
}
.owl-prev:before {
content: "\f104"
}
.owl-next {
right: 0
}
.owl-next:before {
content: "\f105"
}
.owl-prev:hover,
.owl-next:hover {
background-color: #000
}
.owl-dots {
position: absolute;
bottom: 1px;
width: 33.33%;
left: 0;
right: 0;
margin: auto;
text-align: center
}
.owl-dot {
background: #fff;
height: 3px;
width: 10px;
display: inline-block;
margin: 0 5px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
opacity: .6
}
.owl-dot.active,
.owl-dot:hover {
background: #e74c3c
}
.main-carousel {
height: 350px;
overflow: hidden
}
.main-carousel .owl-item {
width: 100%;
}
.carousel-item {
height: 350px;
width: 100%;
position: relative;
padding: 0!important;
display: block;
overflow: hidden
}
.carousel-item .box-image {
height: 350px;
position: relative;
width: 100%;
display: block
}
.carousel-item .box-image:after {
content: no-close-quote;
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 151px;
background: url(http://3.bp.blogspot.com/-LnvazGBvKh8/VskckSkmzxI/AAAAAAAAC4s/erEgI6A_ih4/s1600-r/metabg.png) repeat-x;
opacity: .8
}
.carousel-content {
position: absolute;
bottom: 0;
width: 100%;
z-index: 2;
box-sizing: border-box
}
.carousel-item .carousel-content {
padding: 15px;
text-align: center;
}
.carousel-item .recent-title {
margin: 10px 0 5px;
font-size: 19px;
font-weight: 400
}
.carousel-item .recent-title a {
color: #fff;
display: block;
line-height: 1.4em;
text-shadow: 0 .5px .5px rgba(34, 34, 34, 0.3)
}
.carousel-item .recent-author {
color: #fff;
}
.carousel-item .recent-date {
visibility: hidden;
display: none;
}
.carousel-tag a {
display: inline-block;
background-color: #e74c3c;
color: #fff;
height: 20px;
line-height: 20px;
padding: 0 6px;
font-size: 11px;
text-transform: uppercase;
border-radius: 2px
}
.carousel-tag a:before {
content: "\f091";
font-family: FontAwesome;
font-weight: 400;
font-style: normal;
line-height: 1;
padding-right: 4px;
}
.recent-author::before {
content: '\f007';
font-family: fontawesome;
color: #bbb;
margin-right: 5px;
}
.recent-author {
margin-right: 10px;
}
.carousel-overlay {
position: absolute;
left: 0;
top: 0;
z-index: 1;
width: 100%;
height: 100%;
background-color: rgba(40, 35, 40, 0.05)
}
.main-carousel .owl-item:hover .carousel-overlay {
background-color: $mainbgcolor;
opacity:0.5;
}
.carousel-overlay:before {
z-index: 3;
border-top: 1px solid #fff;
border-bottom: 1px solid #fff;
-webkit-transform: scale(0,1);
transform: scale(0,1);
}
.carousel-overlay:after {
z-index: 3;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
-webkit-transform: scale(1,0);
transform: scale(1,0);
}
.carousel-overlay:before, .carousel-overlay:after {
z-index: 3;
position: absolute;
top: 10px;
right: 10px;
bottom: 10px;
left: 10px;
content: '';
opacity: 0;
-webkit-transition: opacity 0.5s, -webkit-transform 0.5s;
transition: opacity 0.5s, transform 0.5s;
}
.main-carousel .owl-item:hover .carousel-overlay:before, .main-carousel .owl-item:hover .carousel-overlay:after {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
.main-carousel .owl-prev,
.main-carousel .owl-next {
margin-top: 0px;
width: 40px;
height: 40px;
font-size: 25px;
line-height: 40px
}
.main-carousel .owl-prev {
left: -50px
}
.main-carousel:hover .owl-prev {
left: 0
}
.main-carousel .owl-next {
right: -50px
}
.main-carousel:hover .owl-next {
right: 0
}
.main-carousel .owl-dots {
bottom: 10px
}

missing css to fix this toggle switch, z-index issue?

This codepen has a yes / no toggle. the Yes doesn't display after the toggle has moved over it, but the No works? What css will get the Yes to show up?
https://codepen.io/trynn/pen/NWPNMdE
input[type="radio"].toggle {
display: none;
& + label{
cursor: pointer;
min-width: 60px;
border-radius: 30px;
&:hover{
background: none;
}
&:after{
background: blue;
content: "";
height: 100%;
position: absolute;
z-index:-1;
border-radius: 30px;
top: 0;
transition: left 200ms cubic-bezier(0.77, 0, 0.175, 1);
width: 100%;
}
}
&.toggle-left + label {
border-right: 0;
color: #fff;
&:after{
left: 100%;
}
}
&.toggle-right + label{
margin-left: -5px;
color: #fff;
&:after{
left: -100%;
}
}
&:checked + label {
cursor: default;
color: #fff;
transition: color 200ms;
&:after{
left: 0;
}
}
}
You added 2 blue bubbles for toggle-left and toggle-right since you only needed one of them moving from one to another. For your case, in order to not go over the 'yes', you should remove the :after in toggle-right. Try this:
.toggle-switch-container {
position: relative;
line-height: 32px;
border-radius: 30px;
width: fit-content;
margin-left: auto;
margin-right: auto;
margin-bottom:25px;
background-color: rgba(0, 0, 0, 1);
z-index:1;
}
.btn{
display: inline-block;
padding: 10px;
position: relative;
text-align: center;
transition: background 600ms ease, color 600ms ease;
z-index:100;
}
input[type="radio"].toggle {
display: none;
& + label{
cursor: pointer;
min-width: 60px;
border-radius: 30px;
&:hover{
background: none;
}
}
&.toggle-left + label {
border-right: 0;
color: #fff;
&:after{
background: blue;
content: "";
height: 100%;
position: absolute;
z-index:-1;
border-radius: 30px;
top: 0;
transition: left 200ms cubic-bezier(0.77, 0, 0.175, 1);
width: 100%;
left: 100%;
}
}
&.toggle-right + label{
margin-left: -5px;
color: #fff;
}
&:checked + label {
cursor: default;
color: #fff;
transition: color 200ms;
&:after{
left: 0;
}
}
}
For a simple explanation why this works: for 2 elements having the same z-index, the last element comes in front of the other. Your 2 toggle buttons had the same z-index, so their :after, so the toggle-right:after comes in front of toggle-left blocking the 'yes'. By removing the :after of toggle-right, you removed the element blocking the 'yes' solving the problem.
I think you are looking for this
body {
background-color: #ddd;
}
/*Style main div and remove default checkbox*/
.switch {
position: relative;
width: 75px;
margin: 0 auto;
}
.switch-checkbox {
display: none;
}
/*Style words and oval switch */
.switch-labels {
display: block;
overflow: hidden;
cursor: pointer;
border-radius: 20px;
}
.switch-text {
display: block;
width: 200%;
margin-left: -100%;
transition: margin 0.3s ease-in 0s;
}
.switch-text:before,
.switch-text:after {
float: left;
width: 50%;
line-height: 30px;
color: white;
box-sizing: border-box;
}
.switch-text:before {
content: "ON";
padding-left: 10px;
background-color: #E1F6FF;
color: #000000;
}
.switch-text:after {
content: "OFF";
padding-right: 10px;
background-color: #4D5585;
color: #FFFFFF;
text-align: right;
}
/*Style center dot*/
.switch-dot {
width: 30px;
height: 30px;
background: #FFFFFF;
position: absolute;
top: 0;
bottom: 0;
right: 41px;
margin-right: 5px;
border-radius: 20px;
transition: all 0.3s ease-in 0s;
}
.switch-dot:after{
content: "";
position: absolute;
width: 20px;
height: 20px;
background-size: cover;
background-image: url('http://www.free-icons-download.net/images/multiply-icon-27981.png');
margin: 5px 0 0 5px;
}
/*State changer*/
.switch-checkbox:checked+.switch-labels .switch-text {
margin-left: 0;
}
.switch-checkbox:checked+.switch-labels .switch-dot {
right: 0px;
margin-right: 0px;
}
<div class="switch">
<input type="checkbox" name="switch" class="switch-checkbox" id="myswitch" checked>
<label class="switch-labels" for="myswitch">
<span class="switch-text"></span>
<span class="switch-dot"></span>
</label>
</div>
Using 2 text as on and off
.toggle-label {
position: relative;
display: block;
width: 300px;
height: 80px;
margin-top: 8px;
border: 1px solid #808080;
margin: 200px auto;
}
.toggle-label input[type=checkbox] {
opacity: 0;
position: absolute;
width: 100%;
height: 100%;
}
.toggle-label input[type=checkbox]+.back {
position: absolute;
width: 100%;
height: 100%;
background: #ed1c24;
transition: background 150ms linear;
}
.toggle-label input[type=checkbox]:checked+.back {
background: #00a651; /*green*/
}
.toggle-label input[type=checkbox]+.back .toggle {
display: block;
position: absolute;
content: ' ';
background: #fff;
width: 50%;
height: 100%;
transition: margin 150ms linear;
border: 1px solid #808080;
border-radius: 0;
}
.toggle-label input[type=checkbox]:checked+.back .toggle {
margin-left: 150px;
}
.toggle-label .label {
display: block;
position: absolute;
width: 50%;
color: #000;
line-height: 80px;
text-align: center;
font-size: 2em;
}
.toggle-label .label.on { left: 0px; }
.toggle-label .label.off { right: 0px; }
.toggle-label input[type=checkbox]:checked+.back .label.on {
color: #fff;
}
.toggle-label input[type=checkbox]+.back .label.off {
color: #000;
}
.toggle-label input[type=checkbox]:checked+.back .label.off {
color: #000;
}
<label class='toggle-label'>
<input type='checkbox'/>
<span class='back'>
<span class='toggle'></span>
<span class='label on'>ON</span>
<span class='label off'>OFF</span>
</span>
</label>

parse errors in css using #media and keyframes

/*general CSS setting for generic devices
this will include all hd devices and above*/
* {
margin: 0;
padding: 0;
}
#watchonly {
display: none;
}
/*animation of the championship logo*/
#champ {
position: absolute;
top: 15%;
right: 20%;
animation-name: champ;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes champ {
0% {
right: 20%;
top: 15%;
}
25% {
right: 22%;
top: 16%;
}
50% {
right: 20%;
top: 17%;
}
75% {
right: 19%;
top: 16%;
}
100% {
right: 20%;
top: 15%;
transform: rotateY(360deg);
}
}
/*navigation controls*/
nav ul li {
display: inline;
}
nav ul li a, nav ul li a:visited {
color: #006734;
display: block;
float: left;
font-size: 1.25em;
font-weight: bold;
margin: 5px 2px;
padding: 7px 10px 4px;
text-shadow: 0 1px 1px white;
text-transform: uppercase;
}
nav ul li a:hover {
text-decoration: none;
background-color: #009340;
}
nav, main, nav ul li a, .twitter-timeline {
border-radius: 30px;
}
nav {
background: #6fad60;
padding: 0 5px;
position: absolute;
right: 0;
top: 4px;
border: 1px solid #0e1f0c;
box-shadow: 0 1px 1px #0e1f0c;
}
/*switching off the watch only text*/
#watchonly {
display: none;
}
.clear:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
body {
font-size: 15px;
color: #f8f8f8;
background-color: #bcbcbc;
font-family: Arial, Helvetica, sans-serif;
}
/*the default font*/
h1, h2, h3 {
font-family: "Myriad Pro", "Helvetica Neue", Helvetica, Arial, Sans-Serif;
color: #00923f;
text-shadow: 0 1px 1px black;
}
h1 {
font-size: 35px;
padding: 3px;
text-transform: uppercase;
}
h3 {
font-family: forte, "Myriad Pro", "Helvetica Neue", Helvetica, Arial, Sans-Serif;
font-size: 30px;
font-weight: normal;
margin: 2px;
}
img {
width: auto;
height: 100%;
}
p {
line-height: 120%;
padding-bottom: 2px;
}
main .line {
background-color: #15242a;
border-bottom-color: #204656;
margin: 3px;
}
.line {
height: 1px;
background-color: #24404c;
border-bottom: 1px solid #416371;
margin: 2px;
overflow: hidden;
}
footer .line {
margin: 2px;
}
/*Main page size*/
#page {
width: 900px;
margin: 0 auto;
position: relative;
}
main {
background-color: #006634;
margin: 2px;
padding: 20px;
text-shadow: 0 2px 0 #001f10;
margin-top: 20px;
}
footer {
color: #000000;
margin-bottom: 30px;
text-align: center;
font-size: 10px;
}
footer a, footer a:visited {
color: #6fad60;
background-color: #006634;
padding: 2px 4px;
}
footer a:hover {
text-decoration: none;
background-color: #000000;
}
footer a.up {
float: right;
}
/*control of the twitter frame*/
.twitter-timeline {
border: 3px solid #00943f;
float: right;
margin-left: 15px;
overflow: hidden;
}
#twitter-widget-0 {
height: 500px !important;
min-height: 500px !important;
}
a, a:visited {
color: #ffffff;
text-decoration: none;
outline: none;
}
a:hover {
color: black;
text-decoration: underline;
}
a img {
border: none;
}
iframe {
width: 100%;
height: 600px;
}
/*turning off the image and allowing the iframe to show*/
#whensmall {
display: none;
}
/*control of the form*/
form {
padding: 20px;
}
textarea {
height: 300px;
width: 275px;
}
input {
padding-left: 90px;
}
/*control of map iframe*/
.map {
width: 300px;
height: 350px;
}
/*a very simple default for future use on limited screens
ie watches or screens under 300px square*/
#media only screen and (max-width: 300px) {
* {
margin: 0;
padding: 0;
}
/*Main page size*/
#page {
width: 290px;
margin: 0 auto;
position: relative;
}
/*switching off most of the page contect*/
#watchonly {
font-style: oblique;
display: flex;
color: black;
text-shadow: 0 1px 1px white;
}
footer, nav, h1, h2, h3, p, #main, .line, #champ {
display: none;
}
img {
float: left;
float: right;
padding-top: 60px;
max-width: 280px;
max-height: 200px;
}
}
/*Control of elements for small phone screens over 300 wide and below 500px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 301px) and (max-width: 500px) {
/*switching off the iframe, large champions image and the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: none;
}
#watchonly {
display: none;
}
/*animation of the championship logo*/
#champ {
position: absolute;
top: 0%;
right: 0%;
height: 55px;
animation-duration: 5s;
animation-name: champ1;
animation-timing-function: ease-in-out;
animation-delay: 2s;
transform: rotateY(360deg);
}
#keyframes champ1 {
0% {
right: 0%;
top: 0%;
}
25% {
right: 2%;
top: 2%;
}
50% {
right: 4%;
top: 1%;
transform: rotateY(160deg);
}
75% {
right: 2%;
top: 2%;
}
100% {
right: 0%;
top: 0%;
}
}
ul {
padding: 0%;
text-align: center;
display: inline;
}
nav ul li a, nav ul li a:visited {
color: #006734;
font-size: 12px;
font-weight: bold;
margin: 0px 0px;
padding: 10px 5px 10px;
text-shadow: 0 1px 1px white;
text-transform: uppercase;
}
/*change of the navigation*/
nav ul li {
display: inline;
}
nav {
position: relative;
}
/*Main page size*/
#page {
width: 295px;
margin: 0 auto;
position: relative;
}
/*map size change*/
.map {
width: 260px;
}
/*switching the twitter so as to leave only a link*/
#twitter-widget-0 {
height: 45px !important;
min-height: 5px !important;
}
.twitter-timeline {
border: 3px solid #00943f;
height: 300px;
overflow: hidden;
width: 200px;
}
/*edit of the font sizes*/
h1 {
font-size: 18px;
text-transform: uppercase;
}
h3 {
font-size: 20px;
font-weight: normal;
margin: 2px;
}
/*edit to control a smaller form*/
form {
padding: 30px;
}
textarea {
height: 300px;
width: 185px;
}
input {
padding-left: 0px;
}
}
/*Control of elements for larger phone screens/small tablets over 500 wide and below 700px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 501px) and (max-width: 700px) {
/*switching off the iframe, switching on the large champions
image and off the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: inline;
}
#watchonly {
display: none;
}
/*edit of the font sizes*/
h1 {
font-size: 30px;
text-transform: uppercase;
}
h3 {
font-size: 26px;
}
/*Main page size*/
#page {
width: 490px;
margin: 0 auto;
position: relative;
}
/*change of the navigation*/
nav ul li {
display: block;
}
/*animation of the championship logo*/
#champ {
position: fixed;
top: 36%;
right: 0%;
height: 75px;
animation-name: Champ2;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes Champ2 {
0% {
right: 00%;
top: 36%;
}
5% {
right: 05%;
top: 29%;
}
10% {
right: 10%;
top: 20%;
}
15% {
right: 15%;
top: 13%;
}
20% {
right: 20%;
top: 07%;
}
25% {
right: 25%;
top: 05%;
}
30% {
right: 30%;
top: 07%;
}
35% {
right: 35%;
top: 13%;
}
40% {
right: 40%;
top: 20%;
}
45% {
right: 45%;
top: 29%;
}
50% {
right: 50%;
top: 36%;
transform: rotateY(360deg);
}
55% {
right: 45%;
top: 43%;
}
60% {
right: 40%;
top: 52%;
}
65% {
right: 35%;
top: 59%;
}
70% {
right: 30%;
top: 65%;
}
75% {
right: 25%;
top: 66%;
}
80% {
right: 20%;
top: 65%;
}
85% {
right: 15%;
top: 59%;
}
90% {
right: 10%;
top: 52%;
}
95% {
right: 05%;
top: 43%;
}
100% {
right: 00%;
top: 36%;
}
}
/*control of the twitter frame size*/
#twitter-widget-0 {
width: 100px !important;
height: 600px !important;
}
/*control of the map iframe size*/
.map {
width: 250px;
height: 300px;
padding-bottom: 40px;
}
/*edit to control a smaller form*/
form {
padding: 20px;
}
textarea {
height: 300px;
width: 185px;
}
input {
padding-left: 0px;
}
}
/*Control of elements for large phone screens/sd tablets over 700 wide and below 900px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 701px) and (max-width: 900px) {
/*switching off the iframe, switching on the large champions
image and off the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: inline;
padding: 100px;
}
#watchonly {
display: none;
}
/*Font size control*/
h1 {
font-size: 44px;
text-transform: uppercase;
padding: 0px 0px 0px;
}
h3 {
font-size: 38px;
}
/*Main page size*/
#page {
width: 700px;
margin: 0 auto;
position: relative;
}
/*edit of the navigation bar*/
nav ul li {
display: block;
}
/*Animation of the championship logo*/
#champ {
position: absolute;
top: 10px;
right: 30vw;
animation-name: champ3;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes champ3 {
0% {
right: 30vw;
top: 10px;
}
10% {
right: 25vw;
top: 25px;
}
18% {
right: 25vw;
top: 40px;
}
24% {
right: 30vw;
top: 55px;
}
32% {
right: 35vw;
top: 70px;
}
40% {
right: 35vw;
top: 85px;
}
48% {
right: 30vw;
top: 100px;
transform: rotateY(360deg);
}
56% {
right: 25vw;
top: 85px;
}
64% {
right: 25vw;
top: 70px;
}
72% {
right: 30vw;
top: 55px;
}
80% {
right: 35vw;
top: 40px;
}
90% {
right: 35vw;
top: 25px;
}
100% {
right: 30vw;
top: 10px;
}
}
/*twitter frame size*/
#twitter-widget-0 {
width: 300px !important;
min-height: 5px !important;
}
/*map iframe size*/
.map {
width: 300px;
height: 300px;
padding-bottom: 40px;
}
/*form size controls*/
form {
padding: 50px;
}
textarea {
height: 300px;
width: 245px;
}
input {
padding-left: 60px;
}
}
I have been trying to validate my website via the w3c validator.
the html5 passes yet the CSS will not.
I receive parse errors (x6) at keyframes.
I have tried various french bracket arrangments as it would appear that the differing ones get picked up incorrectly
I have included my CSS
any help is much appreciated
This is my first attempt at html and css
/*general CSS setting for generic devices
this will include all hd devices and above*/
* {
margin: 0;
padding: 0;
}
#watchonly {
display: none;
}
/*animation of the championship logo*/
#champ {
position: absolute;
top: 15%;
right: 20%;
animation-name: champ;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes champ {
0% {
right: 20%;
top: 15%;
}
25% {
right: 22%;
top: 16%;
}
50% {
right: 20%;
top: 17%;
}
75% {
right: 19%;
top: 16%;
}
100% {
right: 20%;
top: 15%;
transform: rotateY(360deg);
}
}
/*navigation controls*/
nav ul li {
display: inline;
}
nav ul li a, nav ul li a:visited {
color: #006734;
display: block;
float: left;
font-size: 1.25em;
font-weight: bold;
margin: 5px 2px;
padding: 7px 10px 4px;
text-shadow: 0 1px 1px white;
text-transform: uppercase;
}
nav ul li a:hover {
text-decoration: none;
background-color: #009340;
}
nav, main, nav ul li a, .twitter-timeline {
border-radius: 30px;
}
nav {
background: #6fad60;
padding: 0 5px;
position: absolute;
right: 0;
top: 4px;
border: 1px solid #0e1f0c;
box-shadow: 0 1px 1px #0e1f0c;
}
/*switching off the watch only text*/
#watchonly {
display: none;
}
.clear:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
body {
font-size: 15px;
color: #f8f8f8;
background-color: #bcbcbc;
font-family: Arial, Helvetica, sans-serif;
}
/*the default font*/
h1, h2, h3 {
font-family: "Myriad Pro", "Helvetica Neue", Helvetica, Arial, Sans-Serif;
color: #00923f;
text-shadow: 0 1px 1px black;
}
h1 {
font-size: 35px;
padding: 3px;
text-transform: uppercase;
}
h3 {
font-family: forte, "Myriad Pro", "Helvetica Neue", Helvetica, Arial, Sans-Serif;
font-size: 30px;
font-weight: normal;
margin: 2px;
}
img {
width: auto;
height: 100%;
}
p {
line-height: 120%;
padding-bottom: 2px;
}
main .line {
background-color: #15242a;
border-bottom-color: #204656;
margin: 3px;
}
.line {
height: 1px;
background-color: #24404c;
border-bottom: 1px solid #416371;
margin: 2px;
overflow: hidden;
}
footer .line {
margin: 2px;
}
/*Main page size*/
#page {
width: 900px;
margin: 0 auto;
position: relative;
}
main {
background-color: #006634;
margin: 2px;
padding: 20px;
text-shadow: 0 2px 0 #001f10;
margin-top: 20px;
}
footer {
color: #000000;
margin-bottom: 30px;
text-align: center;
font-size: 10px;
}
footer a, footer a:visited {
color: #6fad60;
background-color: #006634;
padding: 2px 4px;
}
footer a:hover {
text-decoration: none;
background-color: #000000;
}
footer a.up {
float: right;
}
/*control of the twitter frame*/
.twitter-timeline {
border: 3px solid #00943f;
float: right;
margin-left: 15px;
overflow: hidden;
}
#twitter-widget-0 {
height: 500px !important;
min-height: 500px !important;
}
a, a:visited {
color: #ffffff;
text-decoration: none;
outline: none;
}
a:hover {
color: black;
text-decoration: underline;
}
a img {
border: none;
}
iframe {
width: 100%;
height: 600px;
}
/*turning off the image and allowing the iframe to show*/
#whensmall {
display: none;
}
/*control of the form*/
form {
padding: 20px;
}
textarea {
height: 300px;
width: 275px;
}
input {
padding-left: 90px;
}
/*control of map iframe*/
.map {
width: 300px;
height: 350px;
}
/*a very simple default for future use on limited screens
ie watches or screens under 300px square*/
#media only screen and (max-width: 300px) {
* {
margin: 0;
padding: 0;
}
/*Main page size*/
#page {
width: 290px;
margin: 0 auto;
position: relative;
}
/*switching off most of the page contect*/
#watchonly {
font-style: oblique;
display: flex;
color: black;
text-shadow: 0 1px 1px white;
}
footer, nav, h1, h2, h3, p, #main, .line, #champ {
display: none;
}
img {
float: left;
float: right;
padding-top: 60px;
max-width: 280px;
max-height: 200px;
}
}
/*Control of elements for small phone screens over 300 wide and below 500px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 301px) and (max-width: 500px) {
/*switching off the iframe, large champions image and the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: none;
}
#watchonly {
display: none;
}
/*animation of the championship logo*/
#champ {
position: absolute;
top: 0%;
right: 0%;
height: 55px;
animation-duration: 5s;
animation-name: champ1;
animation-timing-function: ease-in-out;
animation-delay: 2s;
transform: rotateY(360deg);
}
#keyframes champ1 {
0% {
right: 0%;
top: 0%;
}
25% {
right: 2%;
top: 2%;
}
50% {
right: 4%;
top: 1%;
transform: rotateY(160deg);
}
75% {
right: 2%;
top: 2%;
}
100% {
right: 0%;
top: 0%;
}
}
ul {
padding: 0%;
text-align: center;
display: inline;
}
nav ul li a, nav ul li a:visited {
color: #006734;
font-size: 12px;
font-weight: bold;
margin: 0px 0px;
padding: 10px 5px 10px;
text-shadow: 0 1px 1px white;
text-transform: uppercase;
}
/*change of the navigation*/
nav ul li {
display: inline;
}
nav {
position: relative;
}
/*Main page size*/
#page {
width: 295px;
margin: 0 auto;
position: relative;
}
/*map size change*/
.map {
width: 260px;
}
/*switching the twitter so as to leave only a link*/
#twitter-widget-0 {
height: 45px !important;
min-height: 5px !important;
}
.twitter-timeline {
border: 3px solid #00943f;
height: 300px;
overflow: hidden;
width: 200px;
}
/*edit of the font sizes*/
h1 {
font-size: 18px;
text-transform: uppercase;
}
h3 {
font-size: 20px;
font-weight: normal;
margin: 2px;
}
/*edit to control a smaller form*/
form {
padding: 30px;
}
textarea {
height: 300px;
width: 185px;
}
input {
padding-left: 0px;
}
}
/*Control of elements for larger phone screens/small tablets over 500 wide and below 700px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 501px) and (max-width: 700px) {
/*switching off the iframe, switching on the large champions
image and off the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: inline;
}
#watchonly {
display: none;
}
/*edit of the font sizes*/
h1 {
font-size: 30px;
text-transform: uppercase;
}
h3 {
font-size: 26px;
}
/*Main page size*/
#page {
width: 490px;
margin: 0 auto;
position: relative;
}
/*change of the navigation*/
nav ul li {
display: block;
}
/*animation of the championship logo*/
#champ {
position: fixed;
top: 36%;
right: 0%;
height: 75px;
animation-name: Champ2;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes Champ2 {
0% {
right: 00%;
top: 36%;
}
5% {
right: 05%;
top: 29%;
}
10% {
right: 10%;
top: 20%;
}
15% {
right: 15%;
top: 13%;
}
20% {
right: 20%;
top: 07%;
}
25% {
right: 25%;
top: 05%;
}
30% {
right: 30%;
top: 07%;
}
35% {
right: 35%;
top: 13%;
}
40% {
right: 40%;
top: 20%;
}
45% {
right: 45%;
top: 29%;
}
50% {
right: 50%;
top: 36%;
transform: rotateY(360deg);
}
55% {
right: 45%;
top: 43%;
}
60% {
right: 40%;
top: 52%;
}
65% {
right: 35%;
top: 59%;
}
70% {
right: 30%;
top: 65%;
}
75% {
right: 25%;
top: 66%;
}
80% {
right: 20%;
top: 65%;
}
85% {
right: 15%;
top: 59%;
}
90% {
right: 10%;
top: 52%;
}
95% {
right: 05%;
top: 43%;
}
100% {
right: 00%;
top: 36%;
}
}
/*control of the twitter frame size*/
#twitter-widget-0 {
width: 100px !important;
height: 600px !important;
}
/*control of the map iframe size*/
.map {
width: 250px;
height: 300px;
padding-bottom: 40px;
}
/*edit to control a smaller form*/
form {
padding: 20px;
}
textarea {
height: 300px;
width: 185px;
}
input {
padding-left: 0px;
}
}
/*Control of elements for large phone screens/sd tablets over 700 wide and below 900px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 701px) and (max-width: 900px) {
/*switching off the iframe, switching on the large champions
image and off the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: inline;
padding: 100px;
}
#watchonly {
display: none;
}
/*Font size control*/
h1 {
font-size: 44px;
text-transform: uppercase;
padding: 0px 0px 0px;
}
h3 {
font-size: 38px;
}
/*Main page size*/
#page {
width: 700px;
margin: 0 auto;
position: relative;
}
/*edit of the navigation bar*/
nav ul li {
display: block;
}
/*Animation of the championship logo*/
#champ {
position: absolute;
top: 10px;
right: 30vw;
animation-name: champ3;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes champ3 {
0% {
right: 30vw;
top: 10px;
}
10% {
right: 25vw;
top: 25px;
}
18% {
right: 25vw;
top: 40px;
}
24% {
right: 30vw;
top: 55px;
}
32% {
right: 35vw;
top: 70px;
}
40% {
right: 35vw;
top: 85px;
}
48% {
right: 30vw;
top: 100px;
transform: rotateY(360deg);
}
56% {
right: 25vw;
top: 85px;
}
64% {
right: 25vw;
top: 70px;
}
72% {
right: 30vw;
top: 55px;
}
80% {
right: 35vw;
top: 40px;
}
90% {
right: 35vw;
top: 25px;
}
100% {
right: 30vw;
top: 10px;
}
}
/*twitter frame size*/
#twitter-widget-0 {
width: 300px !important;
min-height: 5px !important;
}
/*map iframe size*/
.map {
width: 300px;
height: 300px;
padding-bottom: 40px;
}
/*form size controls*/
form {
padding: 50px;
}
textarea {
height: 300px;
width: 245px;
}
input {
padding-left: 60px;
}
}
Update
According to https://www.w3.org/TR/CSS2/media.html#at-media-rule at-rules (#...) are invalid inside the #media rules (like the #keyframes rules).
So you might have to define the animations outside of the media queries and just assign them to the elements in the media query.
If you put your css in an editor that can auto-indent it you will see the problems
#media only screen and (min-width: 301px) and (max-width: 500px) {
/*switching off the iframe, large champions image and the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: none;
}
#watchonly {
display: none;
}
/*animation of the championship logo*/
#champ {
position: absolute;
#keyframes champ1 {
25% {
right: 2%;
top: 2%;
}
50% {
right: 4%;
top: 1%;
75% {
right: 2%;
top: 2%;
}
100% {
right: 0%;
top: 0%;
}
}
ul {
padding: 0%;
nav ul li a,
nav ul li a:visited {
color: #006734;
/*change of the navigation*/
nav ul li {
display: inline;
}
nav {
position: relative;
}
/*Main page size*/
#page {
width: 295px;
/*map size change*/
.map {
width: 260px;
}
/*switching the twitter so as to leave only a link*/
#twitter-widget-0 {
height: 45px !important;
.twitter-timeline {
border: 3px solid #00943f;
/*edit of the font sizes*/
h1 {
As you can see the code is missing some } and thus wrong nesting is happening.
Your #keyframe cannot been inside your block #champ it must been like this:
`
div {
width: 100px;
height: 100px;
background: red;
position :relative;
-webkit-animation: mymove 5s infinite; /* Safari 4.0 - 8.0 */
animation: mymove 5s infinite;
}
/* Safari 4.0 - 8.0 */
#-webkit-keyframes mymove {
0% {top: 0px;}
25% {top: 200px;}
75% {top: 50px}
100% {top: 100px;}
}
/* Standard syntax */
#keyframes mymove {
0% {top: 0px;}
25% {top: 200px;}
75% {top: 50px}
100% {top: 100px;}
}
<!DOCTYPE html>
<html>
<head>
<style>
</style>
</head>
<body>
<p><strong>Note:</strong> The #keyframes rule is not supported in Internet Explorer 9 and earlier versions.</p>
<div></div>
</body>
</html>
`
See. mymove is variable and it's located at the top level as varialbe
These validators are not end-all be-all authorities on valid html and css. If it works, and the browser doesn't throw any errors then you're fine.

Resources