Well, content in css is not that great especially when your dealing with translations. I guess a simple way to do it is to have 2 <span>s and toggle them depending on the open attribute, but I do agree it's not ideal.
<span>
open
Ah interesting interesting idea. So:
<details> <summary> <span class="open">open text</span> <span class="closed">closed text</span> </summary> ... </details>
with:
details summary span.open {display:none;} details[open] summary span.open {display:inline} details[open] summary span.closed {display:none}
Nice idea.
Nice. For some reason I was thinking on a js solution, but this css solution most definitely works too.
Hi Elena:
Yeah, I try to stay away from JS whenever possible. Using CSS and HTML provides better performance.
Removing JS whenever possible makes the web less fragile.
Hence the original reason for the post. Plus this is probably more accessible as well.
-- rouilj
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Well, content in css is not that great especially when your dealing with translations. I guess a simple way to do it is to have 2
<span>
s and toggle them depending on theopen
attribute, but I do agree it's not ideal.Ah interesting interesting idea. So:
with:
Nice idea.
Nice. For some reason I was thinking on a js solution, but this css solution most definitely works too.
Hi Elena:
Yeah, I try to stay away from JS whenever possible. Using CSS and HTML provides better performance.
Removing JS whenever possible makes the web less fragile.
Hence the original reason for the post. Plus this is probably more accessible as well.
-- rouilj