Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
a Summer day - @697.07 (what is this?)
Activity rating: Four Stars Posts & Arts: 77/1k.beats Random | Recent Posts | Guild Recents
News: There's a great big indie web tomorrow! :smile: Guild Events: Summer Projects

+  MelonLand Forum
|-+  Life & The Web
| |-+  ✁ ∙ Web Crafting
| | |-+  Images with captions, lightboxes, and revealable-alt-text (HTML+CSS!)


« previous next »
Pages: [1] Print Embed
Author Topic: Images with captions, lightboxes, and revealable-alt-text (HTML+CSS!)  (Read 134 times)
Dan Q
Hero Member ⚓︎
*****
View Profile WWWArt


I have no idea what I am doing
⛺︎ My Room
RSS: RSS

Guild Memberships:
Artifacts:
Dan Q Cruisin'I DIDN'T meet Dan Q on Melonland!
« on: a Summer day » Embed

Regulars will know that sometimes I get an idea in my head and can't shake it. A "can this be done with just semantic HTML and CSS?". Here's my latest example. I wanted a (responsive) web page with:

- images,
- that had captions,
- and alt text,
- and that alt-text could be made "visible" with a toggle, like Mastodon does it,
- and clicking the image would show a larger version with a "lightbox" overlay effect
- using no JavaScript
- and the key functionality has to work even if CSS gets disabled,
- and it should all be keyboard-accessible

Here's the image I had in my head (recorded from the finished page on the Everyone Site):



I hope the CSS code (all embedded in the page) is self-explanatory, in case it's any use to anybody else. I've tried to throw a couple of comments in. I haven't the time to turn this one into a full tutorial, I'm afraid.

Logged

https://danq.me/_q26t/badges/dan-q-88x31-lighter.gif https://danq.me/_q26t/badges/dan-q-88x31-peekaboo-scroller.gif https://beige-buttons.danq.dev/beige-buttons-88x31.gif https://embed-html.danq.dev/embed-html-88x31.gif

Artifact Swap: PolyamorousI met Dan Q on Melonland!radio polyDoctor RedactedJoined 2025!
schlime9k
Newbie ⚓︎
*
View Profile WWW


Forever personalising my profile
⛺︎ My Room
StatusCafe: schlime9k
iMood: schlime9k

Guild Memberships:
Artifacts:
Ace HoneyJoined 2025!
« Reply #1 on: a Summer day » Embed

Very elegant solution! Will def use this at some point on my site when I need to as this is just a good accessibility feature. Great work as per usual Dan <333 :dog:

Logged

https://schlime.online/images/buttons/wsw.gif
pepper
Sr. Member ⚓︎
****
View Profile WWWArt


🐾 local furry punk ⛥ she/her
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: mildlypepper
RSS: RSS

Guild Memberships:
Artifacts:
Joined 2025!SpiffoI met Dan Q on Melonland!pepperartemissodie
« Reply #2 on: a Summer day » Embed

Dan I love you this is exactly what I've been planning on building for my gallery re-write!!! Semantic HTML and CSS is also my own priority, I don't have anything against JS but I would prefer my site to work without it being required, and my current gallery setup is very much not accessible.

I'm going to steal this for SURE  :chef:

Logged

  :dog:  I'm verbose. Sorry! (not sorry)

https://mildlypepper.net/media/buttons/pepper-button.png     https://mildlypepper.net/media/gif_collection/noai_tiny.png

Artifact Swap: Puff Creaturesmuggler?? i hardly knower!Monster CreatureSquirtle!!!!
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
MelonLand @000

Minecraft: Online
Join: craft.melonking.net