Option toggle CSS only

Size
2,758 Kb
Views
22,264

How do I make an option toggle css only?

Option toggle CSS only. What is a option toggle css only? How do you make a option toggle css only? This script and codes were developed by Tiberiu Raducea on 25 September 2022, Sunday.

Option toggle CSS only Previews

Option toggle CSS only - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Option toggle CSS only</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="center-everything-cause-we-can"> <label for="contract_toggle" class="contract_toggle"> With Contract? <input type="checkbox" id="contract_toggle" name="contract_toggle"/> <span class="toggle_bar"> <span class="toggle_square"></span> </span>
</label>
</div>
</body>
</html>

Option toggle CSS only - Script Codes CSS Codes

@import url("https://fonts.googleapis.com/css?family=Rubik");
* { margin: 0; padding: 0;
}
html { height: 100%;
}
body { font: 100% 'Rubik', sans-serif; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; height: 100%;
}
.toggle_bar { text-align: center; border: 1px solid #999; background: #afafaf; width: 70px; display: block; box-sizing: border-box; height: 30px; position: relative; overflow: hidden; margin: 1em auto;
}
.toggle_bar .toggle_square { -webkit-transition: left .3s ease; transition: left .3s ease; background: red; position: absolute; top: 0; left: calc(70px - 30px); width: 30px; height: 100%; box-shadow: 0 4px 16px 8px rgba(0, 0, 0, 0.15);
}
.toggle_bar .toggle_square:before { content: "No"; display: block; color: white; line-height: 30px; text-align: center; font-size: 12px; text-transform: uppercase;
}
.contract_toggle input[type=checkbox] { display: none; position: absolute; -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.contract_toggle input[type=checkbox]:checked ~ .toggle_bar .toggle_square { background: green; left: 0;
}
.contract_toggle input[type=checkbox]:checked ~ .toggle_bar .toggle_square:before { content: "Yes";
}
.center-everything-cause-we-can { -ms-flex-item-align: center; -ms-grid-row-align: center; align-self: center; display: block;
}
Option toggle CSS only - Script Codes
Option toggle CSS only - Script Codes
Home Page Home
Developer Tiberiu Raducea
Username tyberiu88
Uploaded September 25, 2022
Rating 3
Size 2,758 Kb
Views 22,264
Do you need developer help for Option toggle CSS only?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Tiberiu Raducea (tyberiu88) Script Codes
Create amazing Facebook ads with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!