Pure CSS read more toggle
How do I make an pure css read more toggle?
What is a pure css read more toggle? How do you make a pure css read more toggle? This script and codes were developed by Kasper Mikiewicz on 21 November 2022, Monday.
Pure CSS read more toggle - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Pure CSS read more toggle</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ .read-more-state { display: none;
}
.read-more-target { opacity: 0; max-height: 0; font-size: 0; transition: .25s ease;
}
.read-more-state:checked ~ .read-more-wrap .read-more-target { opacity: 1; font-size: inherit; max-height: 999em;
}
.read-more-state ~ .read-more-trigger:before { content: 'Show more';
}
.read-more-state:checked ~ .read-more-trigger:before { content: 'Show less';
}
.read-more-trigger { cursor: pointer; display: inline-block; padding: 0 .5em; color: #666; font-size: .9em; line-height: 2; border: 1px solid #ddd; border-radius: .25em;
}
/* Other style */
body { padding: 2%;
}
p { padding: 2%; background: #fff9c6; color: #c7b27e; border: 1px solid #fce29f; border-radius: .25em;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div> <input type="checkbox" class="read-more-state" id="post-1" /> <p class="read-more-wrap">Lorem ipsum dolor sit amet, consectetur adipisicing elit. <span class="read-more-target">Libero fuga facilis vel consectetur quos sapiente deleniti eveniet dolores tempore eos deserunt officia quis ab? Excepturi vero tempore minus beatae voluptatem!</span></p> <label for="post-1" class="read-more-trigger"></label>
</div>
<div> <input type="checkbox" class="read-more-state" id="post-2" /> <ul class="read-more-wrap"> <li>lorem</li> <li>lorem 2</li> <li class="read-more-target">lorem 3</li> <li class="read-more-target">lorem 4</li> </ul> <label for="post-2" class="read-more-trigger"></label>
</div>
</body>
</html>
Pure CSS read more toggle - Script Codes CSS Codes
.read-more-state { display: none;
}
.read-more-target { opacity: 0; max-height: 0; font-size: 0; transition: .25s ease;
}
.read-more-state:checked ~ .read-more-wrap .read-more-target { opacity: 1; font-size: inherit; max-height: 999em;
}
.read-more-state ~ .read-more-trigger:before { content: 'Show more';
}
.read-more-state:checked ~ .read-more-trigger:before { content: 'Show less';
}
.read-more-trigger { cursor: pointer; display: inline-block; padding: 0 .5em; color: #666; font-size: .9em; line-height: 2; border: 1px solid #ddd; border-radius: .25em;
}
/* Other style */
body { padding: 2%;
}
p { padding: 2%; background: #fff9c6; color: #c7b27e; border: 1px solid #fce29f; border-radius: .25em;
}
Developer | Kasper Mikiewicz |
Username | Idered |
Uploaded | November 21, 2022 |
Rating | 4.5 |
Size | 2,344 Kb |
Views | 161,920 |
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!
Name | Size |
Pure CSS modal box | 3,364 Kb |
Comments thread | 3,601 Kb |
Vue.js based Todo list | 5,092 Kb |
Simple loader | 2,645 Kb |
Pure CSS3 Tags | 4,052 Kb |
DragToIncDec | 2,489 Kb |
Responsive color picker | 2,932 Kb |
Love button | 3,597 Kb |
2 CSS objects that will simplify your HTML structure | 4,136 Kb |
Hello bar | 3,237 Kb |
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!
Name | Username | Size |
A Pen by Final Boss tommyb9 | FBtommyb9 | 55,354 Kb |
Count checked checkboxes with jQuery | Mestika | 2,343 Kb |
Template | Indra_z85 | 2,323 Kb |
Social buttons | Flacu | 2,022 Kb |
Progressively reveal dots on a Bezier curve | GreenSock | 2,489 Kb |
Matrix | Stathisnikolaidis | 1,922 Kb |
Calculator | Rzencoder | 4,572 Kb |
Simple content swap | Snografx | 1,859 Kb |
Whyutils | LeYvan | 3,752 Kb |
Zeichensatz | Moklick | 2,058 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!