I’d like to show/hide part of a paragraph as follows:
Starts out looking like this:
► This is the start of the paragraph with fading text
Upon clicking “caret” on left, it looks like this:
▼ This is the start of the paragraph with fading text no longer fading and the rest of the content shown.
Upon clicking the down “caret”, it returns to:
► This is the start of the paragraph with fading text
As I think about this could something like this work?
<div class="partial-text"><a href="">► This is the start of the paragraph with <style=”fadingCSS”> fading text</style></a></div>
<div class="full-text"><a href="">▼ This is the start of the paragraph with fading text no longer fading and the rest of the content shown.</a></div>
CSS I Need Help With
I’ve look at the following but can’t piece it together:
This is sort of beyond my reach so if there is anyone willing to help, it would be greatly appreciated!
The <details>
tag is not a structural HTML element, so I don't think it's really possible to hack what you want with it.
Here's an implementation using checkboxes and sibling selectors, one (of the many) downsides to this is that you'll have to define both your summary and full paragraph. This or similar CSS only applications are not really something I'd recommend doing, though. They're not very extensible, rely on specific HTML structures, and are sort of hard to understand if they're not well documented.