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 |
Confirmation button | 3,519 Kb |
Degree Picker | 4,307 Kb |
Pure CSS modal box | 3,364 Kb |
Animated underline | 2,593 Kb |
Love button | 3,597 Kb |
Pure CSS3 Tags | 4,052 Kb |
Flat switch | 2,555 Kb |
Universal focus, hover, active state for buttons | 2,439 Kb |
Color accordion | 1,925 Kb |
Comments thread | 3,601 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 |
FreeCodeCamp - Simon Game | Ivhed | 8,481 Kb |
Gears | Synvox | 3,278 Kb |
Rotate Demo | Agelber | 3,061 Kb |
Canvas Fireworks | Jackrugile | 6,200 Kb |
Button shaking | SusanneLundblad | 2,227 Kb |
Flexbox slider | Rendro | 3,459 Kb |
Count up | Alanshortis | 2,391 Kb |
Underlined form fields | Mitchdot | 2,323 Kb |
Project -Show the Local Weather | Luciano_Britis | 2,583 Kb |
Obligatory CSS3 UI Nav | Romandiaz | 9,017 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!