CSS check not focus - css

How do I get the animation to occur on :check of radio button instead of :focus?
I tried .radio-button:checked ~ .item-tile and input[type=radio]:checked + .item-tile both not working.
.item .radio-button:focus+.item-tile {
border: 2px solid #079ad9;
-webkit-transform: scale(1.1, 1.1);
-ms-transform: scale(1.1, 1.1);
transform: scale(1.1, 1.1);
}
.item-wrap {
display: flex;
}
.item-tile {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
margin: 15px;
background: white;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
height: 50px;
border-radius: 10px;
}
.item-tile label {
border: 1px solid;
flex: 0;
padding: 0px 10px 0px 5px;
}
.icon {
margin: 0px 5px 0px 5px;
position: relative;
height: 35px;
width: 35px;
border-radius: 50%;
}
.item {
position: relative;
}
.item .radio-button {
opacity: 0;
position: absolute;
top: 0;
left: 0;
bottom: 0;
left: 0;
height: 100%;
width: 100%;
margin: 0;
z-index: 999;
cursor: pointer;
}
.item .item-tile {
-webkit-transition: -webkit-transform 300ms ease;
transition: -webkit-transform 300ms ease;
-o-transition: transform 300ms ease;
transition: transform 300ms ease;
transition: transform 300ms ease, -webkit-transform 300ms ease;
}
<div class="container">
<div class="item-wrap">
<div class="item">
<input id="blue" class="radio-button" type="radio" name="radio" />
<div class="item-tile">
<div class="icon" style="background-color:blue;">
</div>
<label for="blue" class="item-tile-label"><text class="item-text">Blue</text></label>
</div>
</div>
<div class="item">
<input id="elephant" class="radio-button" type="radio" name="radio" />
<div class="item-tile">
<div class="icon" style="background-color:red;">
</div>
<label for="elephant" class="item-tile-label"><text class="item-text">Elephant</text></label>
</div>
</div>
</div>

You'd be looking for .item .radio-button:checked + .item-tile:
.item .radio-button:checked + .item-tile {
border: 2px solid #079ad9;
-webkit-transform: scale(1.1, 1.1);
-ms-transform: scale(1.1, 1.1);
transform: scale(1.1, 1.1);
}
.item-wrap {
display: flex;
}
.item-tile {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
margin: 15px;
background: white;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
height: 50px;
border-radius: 10px;
}
.item-tile label {
border: 1px solid;
flex: 0;
padding: 0px 10px 0px 5px;
}
.icon {
margin: 0px 5px 0px 5px;
position: relative;
height: 35px;
width: 35px;
border-radius: 50%;
}
.item {
position: relative;
}
.item .radio-button {
opacity: 0;
position: absolute;
top: 0;
left: 0;
bottom: 0;
left: 0;
height: 100%;
width: 100%;
margin: 0;
z-index: 999;
cursor: pointer;
}
.item .item-tile {
-webkit-transition: -webkit-transform 300ms ease;
transition: -webkit-transform 300ms ease;
-o-transition: transform 300ms ease;
transition: transform 300ms ease;
transition: transform 300ms ease, -webkit-transform 300ms ease;
}
<div class="container">
<div class="item-wrap">
<div class="item">
<input id="blue" class="radio-button" type="radio" name="radio" />
<div class="item-tile">
<div class="icon" style="background-color:blue;">
</div>
<label for="blue" class="item-tile-label"><text class="item-text">Blue</text></label>
</div>
</div>
<div class="item">
<input id="elephant" class="radio-button" type="radio" name="radio" />
<div class="item-tile">
<div class="icon" style="background-color:red;">
</div>
<label for="elephant" class="item-tile-label"><text class="item-text">Elephant</text></label>
</div>
</div>
</div>

Related

CSS Causing Website To Crash On Mobile Device? [duplicate]

The HTML and CSS I've used to create a website are listed below. I'm currently trying to get it online, but I am having trouble running it on a mobile device. The website works without any problems on my Macbook, but when I try running it via a MAMP server on my iPhone 12, it crashes (freezing and will no longer load properly) after viewing a few pages. When my iPhone is connected to Wi-Fi, it runs as it should. It doesn't run as it should when connected to 4G, even with a good connection.
Would this have anything to do with my website being too heavy to run smoothly on a mobile device? Any advice would be much appreciated.
<!DOCTYPE html>
<html lang="en">
<meta name="viewport" content="width=device-width, initial-scale=1.0;" charset="utf-8">
<body>
<style>html{visibility: hidden; opacity: 0;}</style>
<title>MORIKOBOSHI・</title>
<div class="page-wrap">
<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: .05px solid lightgray;">Home</li>
<li style="border-bottom: .05px solid lightgray;">Blog</li>
<li style="border-bottom: .05px solid lightgray;">About This Website</li>
<li style="border-bottom: .05px solid lightgray;">Bibliography</li>
<div class="searchbar">
<form id="frmSearch" class="search2" method="get" action="default.html" style=" padding-right: 10px; padding-top: 20px; text-align: center; position: inline;">
<input class="search2" id="txtSearch" type="text" placeholder="Custom Google Search" name="serach_bar" size="31" maxlength="255" value="" style="top: 185px; width: 180px; height: 26px;">
<input class="search1" type="submit" name="submition" value="Search" style="padding-left: 5px; top: 153px; height: 25px; width: 50px; display: inline-flex; justify-content: center;">
<input class="search2" type="hidden" name="sitesearch" value="default.html">
</form>
</div>
<script type="text/javascript">
document.getElementById('frmSearch').onsubmit = function() {
window.location = 'http://www.google.com/search?q=site:morikoboshi.com' + document.getElementById('txtSearch').value;
return false;
}
</script>
<script>
document.getElementById('cp_toggle03').onchange = function() {
if (document.getElementById('cp_toggle03').checked) {
document.body.style.overflow = "hidden";
} else {
document.body.style.overflow = "";
}
}
if(!!window.performance && window.performance.navigation.type == 2)
{
window.location.reload();
}
</script>
</ul>
</nav>
</header>
<div class="setsumei">
<br><br><h1 style="text-align: center; font-size: 40px;">◯◯◯◯</h1>
<br><p style="text-align: justify; font-size: 16px;"></p>
<p style="text-align: center; font-size: 13px;">Author: ◯◯◯◯</p>
<p style="text-align: center; font-size: 13px;">Photos/Videos Taken:◯◯◯◯/◯◯/◯◯</p>
<br><br><p style="text-align: justify; font-size: 16px;">
#
</p>
</div>
<br><br><div class="image">
<img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
</div>
<br><br><footer class="site-footer" style="font-size: 12px;">MORIKOBOSHI© | 日本語</footer>
</div>
</div>
<style>
html {visibility: visible;
opacity: 1;}
.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%;
/* equal to footer height */
margin-bottom: -40px;
}
.page-wrap:after {
content: "";
display: block;
}
.site-footer, .page-wrap:after {
/* .push must be the same height as footer */
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;
}
</style>
</body>
</html>
I would like to thank everyone for their help in trying to solve this issue.
After deleting bits of CSS to see how my website runs without it I found the solution. It was the html { visibility: hidden; opacity: 0; } line of code that was preventing my website from running smoothly on the mobile version of Google Chrome. Getting rid of this line of code stopped my website from freezing.

Compatibility With The Mobile Version Of Google Chrome

I'm a beginner in HTML, CSS, and Javascript and am currently in the process of getting a website that I built online. I'm testing it in all browsers to make sure that it works without any issues, but am noticing some issues when on a mobile browser. Specifically, I'm noticing that my website freezes and becomes unusable after viewing a few pages when trying to use it in the mobile version of Google Chrome.
Below is the code that I'm using and if I'm not mistaken I'm sure that there is a line of code inside my CSS that is making Google Chrome freeze on a mobile device. Can anyone see any line of code that should be taken out or replaced? Are there too many scripts for Google Chrome to handle on a mobile device? If anyone has any knowledge about what could possibly be causing this issue I'd really appreciate you sharing it with me.
<!DOCTYPE html>
<html lang="ja">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0;" charset="utf-8">
<title>MORIKOBOSHI・</title>
</head>
<body>
<div class="page-wrap">
<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; padding-bottom: 10px;">
<li style="border-bottom: .05px solid lightgray;">ホーム</li>
<li style="border-bottom: .05px solid lightgray;">ブログ</li>
<li style="border-bottom: .05px solid lightgray;">このサイトについて</li>
<li style="border-bottom: .05px solid lightgray;">参考文献</li>
<div class="searchbar">
<form id="frmSearch" class="search2" method="get" action="default.html" style=" padding-right: 10px; padding-top: 20px; text-align: center; position: inline;">
<input class="search2" id="txtSearch" type="text" placeholder="Googleカスタム検索" name="serach_bar" size="31" maxlength="255" value="" style="top: 185px; width: 180px; height: 26px;">
<input class="search1" type="submit" name="submition" value="検索" style="padding-left: 5px; top: 153px; height: 25px; width: 34px; display: inline-flex; justify-content: center;">
<input class="search2" type="hidden" name="sitesearch" value="default.html">
</form>
</div>
<script type="text/javascript">
document.getElementById('frmSearch').onsubmit = function() {
window.location = 'http://www.google.com/search?q=site:morikoboshi.com' + document.getElementById('txtSearch').value;
return false;
}
</script>
<script>
document.getElementById('cp_toggle03').onchange = function() {
if (document.getElementById('cp_toggle03').checked) {
document.body.style.overflow = "hidden";
} else {
document.body.style.overflow = "";
}
}
</script>
</ul>
</nav>
</header>
<div class="setsumei">
<br><h1 style="text-align: center; font-size: 40px;">◯◯◯◯</h1>
<br><p style="text-align: justify; font-size: 16px;"></p>
<p style="text-align: center; font-size: 13px;">著者:◯◯◯◯</p>
<p style="text-align: center; font-size: 13px;">撮影日:◯◯◯◯年◯◯月◯◯日</p>
<br><br><p style="text-align: justify; font-size: 16px;">
#
</p>
</div>
<br><br><div class="image">
<img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
<br><br><img src="#" alt="#" width="90%">
</div>
</div>
<br><br><footer class="site-footer" style="font-size: 12px;">MORIKOBOSHI© | English</footer>
</div>
<style>
html {visibility: visible;
opacity: 1;}
.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%;
/* equal to footer height */
margin-bottom: -40px;
}
.page-wrap:after {
content: "";
display: block;
}
.site-footer, .page-wrap:after {
/* .push must be the same height as footer */
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;
}
</style>
</body>
</html>

How can I apply this style to my slideshow?

I would like to apply a different style to my slideshow. Therefore I found one on the internet, which corresponds to my wishes. I tried to insert it, but unfortunately it doesn't work at all. Do you have any idea how I merge CSS code with my slideshow?
slideshow.js
import React from "react";
import { Gallery, GalleryImage } from "react-gesture-gallery";
const images = [
"https://img-9gag-fun.9cache.com/photo/amBjg8y_700bwp.webp",
"https://img-9gag-fun.9cache.com/photo/abYPGB8_700bwp.webp",
"https://img-9gag-fun.9cache.com/photo/abYPgY8_700bwp.webp",
"https://img-9gag-fun.9cache.com/photo/az9NeXq_700bwp.webp",
"https://img-9gag-fun.9cache.com/photo/aPYNZ4Q_700bwp.webp"
];
function Slider() {
const [index, setIndex] = React.useState(0);
return (
<Gallery
style={{
position: "relative",
background: "white",
height: "40vh",
width: "180w"
}}
index={index}
onRequestChange={i => {
setIndex(i);
}}
>
{images.map(image => (
<GalleryImage objectFit="contain" key={image} src={image} />
))}
</Gallery>
);
}
export default Slider;
current css
*,
::after,
::before {
box-sizing: content-box;
}
element.style {
background-color: black;
}
body {
padding: 0px;
}
.App {
font-family: sans-serif;
}
.vertical-timeline-element-icon,
.bounce-in {
box-shadow: 0px 0px transparent;
text-align: center;
margin-bottom: 50px;
}
.adventure {
width: 400px;
}
.vertical-timeline-element-date {
text-align: left;
width: 80%;
}
.img_logo {
width: 60px;
height: 60px;
border-radius: 50%;
}
#media only screen and (min-width: 1170px) {
.vertical-timeline.vertical-timeline--two-columns:before {
left: 50%;
margin-left: -2px;
background: #ddd;
}
}
#media only screen and (max-width: 1172px) {
.vertical-timeline-element-content {
margin-left: 8%;
}
.img_logo {
width: 40px;
height: 40px;
}
}
#media only screen and (max-width: 772px) {
.vertical-timeline-element-content {
margin-left: 14%;
}
}
.loader {
border: 10px solid #bebebe;
border-top: 10px solid #000000;
border-radius: 50%;
width: 70px;
height: 70px;
animation: spin 1s linear infinite;
margin: auto;
margin-top: 20%;
}
.Buttons {
margin-top: 200px;
}
.btn1 {
background-color: #d23c21;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
margin: 4px;
cursor: pointer;
border-radius: 6px;
}
.btn2 {
background-color: #3f66cb;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
margin: 4px;
cursor: pointer;
border-radius: 6px;
}
.btn3 {
background-color: #f69a1d;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
margin: 4px;
cursor: pointer;
border-radius: 6px;
}
.btn4 {
background-color: #4caf50;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
margin: 4px 2px;
cursor: pointer;
border-radius: 6px;
}
.App {
font-family: sans-serif;
text-align: center;
color: black;
}
.home {
margin-top: 10%;
text-align: center;
}
.header {
margin-top: 10%;
text-align: center;
}
.Text {
text-align: center;
width: 50%;
font-size: 100%;
margin: 0 auto;
display: flex;
}
.timeline-badge.primary {
background-color: #ffa500 !important;
}
.timeline-badge.success {
background-color: #ffa500 !important;
}
.timeline-badge.warning {
background-color: #ffa500 !important;
}
.timeline-badge.danger {
background-color: #ffa500 !important;
}
.timeline-badge.info {
background-color: #ffa500 !important;
}
.timeline-title {
margin-top: 0;
color: inherit;
}
.timeline-body > p {
margin-bottom: 0;
width: 80px;
font-size: 22px;
align: center;
text-align: center;
margin-left: 40px;
}
.timeline-body > p + p {
margin-top: 5px;
width: 22px;
text-align: center;
}
.same {
font-size: 20px;
}
.home {
margin-top: 10%;
text-align: center;
}
.header {
margin-top: 10%;
text-align: center;
}
.Text {
text-align: center;
width: 50%;
font-size: 100%;
margin: 0 auto;
display: flex;
}
.Logo {
width: 50%;
}
.event {
display: flex;
position: absolute;
width: 100%;
margin-top: -60px;
transition: background-color 1s ease-in;
height: 700px;
}
.Videotext {
text-align: center;
position: relative;
height: 100%;
width: 50%;
font-size: 100%;
margin-top: 0;
margin-left: 2%;
display: 0;
}
.Video {
width: ´100%;
height: 20%;
margin-bottom: 12%;
background-color: "black";
display: block;
float: left;
transition: width 0.8s ease-out, height 0.3s ease-out;
}
.arrow {
width: 0px;
height: 0px;
position: flex;
border: 50px solid transparent;
border-top-color: orange;
margin: 0;
margin-left: -20px;
padding: 0;
float: left;
margin-top: 75px;
display: 0;
animation-name: meine-animation;
animation-duration: 1s;
animation-iteration-count: infinite;
}
#keyframes meine-animation {
0%,
100% {
border-top-color: orange;
}
50% {
border-top-color: white;
}
75% {
border-top-color: orange;
}
}
.arrow.left {
transform: rotate(90deg) translate(0px, 25px);
-webkit-transform: rotate(90deg) translate(0px, 0px);
-moz-transform: rotate(180deg) translate(0px, 25px);
-o-transform: rotate(180deg) translate(0px, 25px);
-ms-transform: rotate(180deg) translate(0px, 25px) translate(0px, 25px);
}
#boxi {
margin-top: 200px;
}
#animation {
color: orange;
padding: 0px;
position: absolute;
margin-top: 100px;
margin-left: -10px;
}
.slider {
display: block;
margin-left: 50%;
margin-top: 10%;
display: flex;
border-color: rgb(0, 108, 197);
border-width: 5px;
border-style: solid;
}
#media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
.slider {
display: block;
width: 130px;
height: 130px;
display: flex;
border-color: rgb(0, 108, 197);
border-width: 5px;
border-style: solid;
}
}
style i want to insert.css
body {
background:url(http://subtlepatterns.subtlepatterns.netdna-cdn.com/patterns/low_contrast_linen.png) repeat;
-webkit-font-smoothing: subpixel-antialiased;
background-color: rgb(243, 243, 243);
}
#warp {
width: 90%;
max-width: 800px;
background: #595959;
margin: 30px auto;
overflow: hidden;
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0 3px 5px rgba(0, 0, 0, 0.75);
-webkit-box-shadow: 0 3px 5px rgba(0, 0, 0, 0.75);
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
ul#gallery-container {
position: relative;
width: 100%;
max-width: 800px;
height: auto;
padding: 52% 0 10px;
margin: 0;
text-align: center;
display: block;
}
li.gallery-item {display: inline-block;width: 10%;cursor:pointer;*display:inline;}
img.gallery-preview{
background: white;
margin: 0;
padding: 5% 5% 15%;
*padding: 2px 2px 10px;
position: relative;
top: 0;
width: 85%;
height: auto;
max-height: 45px;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
overflow: hidden;
-webkit-transition: all 0.3s ease-out .2s;
-moz-transition: all 0.3s ease-out .2s;
-o-transition: all 0.3s ease-out .2s;
transition: all 0.3s ease-out .2s;
}
ul#gallery-container:hover li img.gallery-preview{opacity: 0.5;-webkit-filter:blur(2px) grayscale(0.5); }
ul#gallery-container:hover li:hover img.gallery-preview{opacity: 1;-webkit-filter:blur(0px) grayscale(0); }
input.gallery-selector:checked ~ label.gallery-label>img.gallery-preview,
ul#gallery-container:hover li:hover img.gallery-preview:hover{
z-index: 5;
box-shadow: 0 4px 5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0 4px 5px rgba(0, 0, 0, 0.75);
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, 0.75);
-webkit-transform: scale(1.25);
-moz-transform: scale(1.25);
-o-transform: scale(1.25);
transform: scale(1.25);
-webkit-transform-origin: bottom center;
-moz-transform-origin: bottom center;
-o-transform-origin: bottom center;
transform-origin: bottom center;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
ul#gallery-container:hover li:hover img.gallery-preview:hover {z-index: 20;}
input.gallery-selector:checked ~ label.gallery-label>img.gallery-preview{background: #333}
input.gallery-selector:checked ~ label.gallery-label:before{
content: " ";
position: relative;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 20px solid #333;
top: -30px;
}
img.gallery-fullsize {
position: absolute;
top: 0px;
left: 0px;
display: block;
width: 100%;
height: auto;
z-index: -1;
opacity: 0;
-webkit-transform: scale(0.25);
-moz-transform: scale(0.25);
-o-transform: scale(0.25);
transform: scale(0.25);
-webkit-transform-origin: bottom center;
-moz-transform-origin: bottom center;
-o-transform-origin: bottom center;
transform-origin: bottom center;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
ul#gallery-container:hover li.gallery-item:active img.gallery-fullsize{
z-index: 50;
opacity: 0.75;
-webkit-filter:blur(10px) grayscale(1);
border-radius: 10%;
-webkit-border-radius: 10%;
-moz-border-radius: 10%;
-webkit-transform-origin: bottom center;
-moz-transform-origin: bottom center;
-o-transform-origin: bottom center;
transform-origin: bottom center;
-webkit-transition: all 0.3s ease-out .2s;
-moz-transition: all 0.3s ease-out .2s;
-o-transition: all 0.3s ease-out .2s;
transition: all 0.3s ease-out .2s;
}
ul#gallery-container:hover li:hover input.gallery-selector:checked ~ img.gallery-fullsize{z-index: 10;opacity: 1;border-radius: 0;-moz-border-radius: 0;-webkit-border-radius: 0;}
input.gallery-selector:checked ~ img.gallery-fullsize {
display: block;
opacity: 1;
z-index: 10;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
-webkit-transform-origin: top center;
-moz-transform-origin: top center;
-o-transform-origin: top center;
transform-origin: top center;
-webkit-transition: all .2s ease-in .3s;
-moz-transition: all .2s ease-in .3s;
-o-transition: all .2s ease-in .3s;
transition: all .2s ease-in .3s;
}
input.gallery-selector {display: none;}
label.gallery-label {cursor: pointer;}
html from style i want to insert.html
<div id="warp">
<ul id="gallery-container">
<li class="gallery-item">
<input checked="checked" type="radio" name="gallery-list" class="gallery-selector" value="1.jpg" id="gallery-item1" />
<img src="http://lorempixel.com/400/200/sports" class="gallery-fullsize" alt="location bateau 135ch" />
<label for="gallery-item1" class="gallery-label">
<img src="http://lorempixel.com/76/50/sports" class="gallery-preview" alt="location bateau 135ch"/>
</label>
</li>
<li class="gallery-item">
<input type="radio" name="gallery-list" class="gallery-selector" value="2.jpg" id="gallery-item2" />
<img src="http://lorempixel.com/400/200/sports/1" class="gallery-fullsize" alt="location bateau 135ch" />
<label for="gallery-item2" class="gallery-label">
<img src="http://lorempixel.com/76/50/sports/1" class="gallery-preview" alt="location bateau 135ch"/>
</label>
</li>
<li class="gallery-item">
<input type="radio" name="gallery-list" class="gallery-selector" value="3.jpg" id="gallery-item3" />
<img src="http://lorempixel.com/400/200/sports/2" class="gallery-fullsize" alt="location bateau 135ch" />
<label for="gallery-item3" class="gallery-label">
<img src="http://lorempixel.com/76/50/sports/2" class="gallery-preview" alt="location bateau 135ch"/>
</label>
</li>
<li class="gallery-item">
<input type="radio" name="gallery-list" class="gallery-selector" value="4.jpg" id="gallery-item4" />
<img src="http://lorempixel.com/400/200/sports/3" class="gallery-fullsize" alt="location bateau 135ch" />
<label for="gallery-item4" class="gallery-label">
<img src="http://lorempixel.com/76/50/sports/3" class="gallery-preview" alt="location bateau 135ch"/>
</label>
</li>
<li class="gallery-item">
<input type="radio" name="gallery-list" class="gallery-selector" value="5.jpg" id="gallery-item5" />
<img src="http://lorempixel.com/400/200/sports/4" class="gallery-fullsize" alt="location bateau 135ch" />
<label for="gallery-item5" class="gallery-label">
<img src="http://lorempixel.com/76/50/sports/4" class="gallery-preview" alt="location bateau 135ch"/>
</label>
</li>
<li class="gallery-item">
<input type="radio" name="gallery-list" class="gallery-selector" value="6.jpg" id="gallery-item6" />
<img src="http://lorempixel.com/400/200/sports/5" class="gallery-fullsize" alt="location bateau 135ch" />
<label for="gallery-item6" class="gallery-label">
<img src="http://lorempixel.com/76/50/sports/5" class="gallery-preview" alt="location bateau 135ch"/>
</label>
</li>
<li class="gallery-item">
<input type="radio" name="gallery-list" class="gallery-selector" value="7.jpg" id="gallery-item7" />
<img src="http://lorempixel.com/400/200/sports/6" class="gallery-fullsize" alt="location bateau 135ch" />
<label for="gallery-item7" class="gallery-label">
<img src="http://lorempixel.com/76/50/sports/6" class="gallery-preview" alt="location bateau 135ch"/>
</label>
</li>
</ul>
</div>
You'll need to create a css file and import it into the component. to set a classname in the JSX pass a className prop with a string.
example css file
.Class {
opacity: 1;
}
example render method from component
import './example.css'
render(){
<div className="Class">something</div>
}
The full documentation can be found here!

How to stretch label over a custom div to achieve radio button click

I'm trying to make a custom radio button. I've found this neat style which I want to tweak a bit so that items are laid out horizontally.Consider the following html:
<div style="margin-left:30px;">
<div class='container'>
<input type="radio" id="rdArts" name="itemcat">
<label for="rdArts">Arts</label>
<div class="check"></div>
</div>
<div class='container'>
<input type="radio" id="rdElectronics" name="itemcat">
<label for="rdElectronics">Electronics</label>
<div class="check"></div>
</div>
<div class='container'>
<input type="radio" id="rdCars" name="itemcat">
<label for="rdCars">Cars</label>
<div class="check"></div>
</div>
</div>
and this css:
.container{
float:left;
position:relative;
margin-right:20px;
}
.container input[type=radio]{
position: absolute;
visibility: hidden;
}
.container label{
display: block;
position: ;
font-weight: 300;
font-size: 1.2em;
padding: 25px 25px 25px 10px;
margin: 10px auto;
height: 30px;
z-index: 9;
cursor: pointer;
-webkit-transition: all 0.25s linear;
}
.container:hover label{
color: #485776;
}
.container:hover .check{
border-color: #485776;
}
.container:hover .check::border{
background-color: #485776;
}
.container .check{
display: block;
position: relative;
border: 4px solid #333E54;
border-radius: 100%;
height: 15px;
width: 15px;
top: -67px;
left: -25px;
z-index: 5;
transition: border .25s linear;
-webkit-transition: border .25s linear;
}
.container .check::before {
display: block;
position: relative;
content: '';
border-radius: 100%;
height: 11px;
width: 11px;
top: 2px;
left: 0px;
margin: auto;
transition: background 0.25s linear;
-webkit-transition: background 0.25s linear;
}
input[type=radio]:checked ~ .check::before{
background: #333E54;
}
I am able to get this:
The only problem is I cannot get click to work on the pseudo radio button itself. I need to click on the label. And the reason is because in my case, label does not stretch over to the ".check" div. What style should I give to my label to make it overlay the div? If you want to see the full html and css,here it is.
This should be working:
I slightly edited the .container label style to move a bit to the left to be above the checkbox images.
.container{
float:left;
position:relative;
margin-right:20px;
}
.container input[type=radio]{
position: absolute;
visibility: hidden;
}
.container label{
display: block;
position: ;
font-weight: 300;
font-size: 1.2em;
height: 30px;
z-index: 9;
cursor: pointer;
-webkit-transition: all 0.25s linear;
margin: 10px auto 10px -26px;
padding: 25px 25px 25px 36px;
position: relative;
}
.container:hover label{
color: #485776;
}
.container:hover .check{
border-color: #485776;
}
.container:hover .check::border{
background-color: #485776;
}
.container .check{
display: block;
position: relative;
border: 4px solid #333E54;
border-radius: 100%;
height: 15px;
width: 15px;
top: -67px;
left: -25px;
z-index: 5;
transition: border .25s linear;
-webkit-transition: border .25s linear;
}
.container .check::before {
display: block;
position: relative;
content: '';
border-radius: 100%;
height: 11px;
width: 11px;
top: 2px;
left: 0px;
margin: auto;
transition: background 0.25s linear;
-webkit-transition: background 0.25s linear;
}
input[type=radio]:checked ~ .check::before{
background: #333E54;
}
<div style="margin-left:30px;">
<div class='container'>
<input type="radio" id="rdArts" name="itemcat">
<label for="rdArts">Arts</label>
<div class="check"></div>
</div>
<div class='container'>
<input type="radio" id="rdElectronics" name="itemcat">
<label for="rdElectronics">Electronics</label>
<div class="check"></div>
</div>
<div class='container'>
<input type="radio" id="rdCars" name="itemcat">
<label for="rdCars">Cars</label>
<div class="check"></div>
</div>
</div>

Text Next to Styled Radio Button

I've customised my radio buttons with the help of this tutorial.
Now I'm trying to add text next to the radio buttons but I can't really figure it out with this structure I've got.
Any ideas?
HTML:
<fieldset>
<div class="radioButton">
<input type="radio" name="x" value="y" id="y" />
<label for="y"></label>
</div>
<div class="radioButton">
<input type="radio" name="x" value="z" id="z" />
<label for="z"></label>
</div>
</fieldset>
CSS:
input[type=radio] {
visibility: visible; }
.radioButton {
width: 22px;
height: 22px;
background: #dedede;
margin: 20px 0px;
border-radius: 100%;
position: relative; }
/* Create the radio button */
.radioButton label {
display: block;
width: 18px;
height: 18px;
border-radius: 100px;
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease;
-ms-transition: all .5s ease;
transition: all .5s ease;
cursor: pointer;
position: absolute;
top: 2px;
left: 2px;
z-index: 1;
background: white; }
/* Radio button checked state */
.radioButton input[type=radio]:checked + label {
background: #77a942; }
/*
Try adding the text inside the label and using CSS to indent it
.radioButton label{
text-indent: 2em;
}
UPDATE
Here's a better implementation using CSS's :before pseudo-element
Demo fiddle
input[type=radio] {
visibility: visible;
}
.radioButton {
height: 22px;
margin: 20px 0px;
position: relative;
}
.radioButton label {
display: inline-block;
vertical-align: middle;
padding-left: 0.5em;
}
/* Create the radio button */
.radioButton label:before {
content:'';
display: inline-block;
width: 18px;
height: 18px;
border-radius: 50%;
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease;
-ms-transition: all .5s ease;
transition: all .5s ease;
cursor: pointer;
position: absolute;
top: 2px;
left: 2px;
z-index: 1;
background: white;
border: solid 2px #ddd;
}
/* Radio button checked state */
.radioButton input[type=radio]:checked + label:before {
background: #77a942;
}
Add a div after the radioButton div with your text. This isn't optimal, because the control has highjacked the label, so you can't click on this text and have the control be clicked (unless you add javascript to do that), but it'll look right. http://jsfiddle.net/MdAEG/
<fieldset>
<div class="radioButton">
<input type="radio" name="x" value="y" id="y" />
<label for="y"></label>
</div>
<div class="radioLabel">Hi there</div>
<div class="radioButton">
<input type="radio" name="x" value="z" id="z" />
<label for="z"></label>
</div>
<div class="radioLabel">Howdy</div>
</fieldset>
input[type=radio] {
visibility: visible; }
.radioLabel {
float: left;
clear:right;
margin: 22px 5px;
}
.radioButton {
width: 22px;
height: 22px;
background: #dedede;
margin: 20px 0px;
border-radius: 100%;
position: relative;
float: left;
clear: left;
}
/* Create the radio button */
.radioButton label {
display: block;
width: 18px;
height: 18px;
border-radius: 100px;
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease;
-ms-transition: all .5s ease;
transition: all .5s ease;
cursor: pointer;
position: absolute;
top: 2px;
left: 2px;
z-index: 1;
background: white; }
/* Radio button checked state */
.radioButton input[type=radio]:checked + label {
background: #77a942; }
Just add the following CSS
label{
padding-left: 23px;
}
Then add some text to your label
<label for="z">Label here</label>
JSFiddle - http://jsfiddle.net/z9Pb9/

Resources