Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
a Summer night - @989.10
Activity rating: Four Stars Posts & Arts: 69/1k.beats Random | Recent Posts | Guild Recents
News: Love is not possession  :4u: Guild Events: 10: window

+  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 482 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!Visited on Melon's 10th Anniversary!
« 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!Joined 2025!
schlime9k
Jr. Member ⚓︎
**
View Profile WWW


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

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!Joined 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

Artifact Swap: Waxed Lightly Weathered Cut Copper StairsSMK LuigiAce Honeymami
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 CreatureMonster CreatureSquirtle!!!!
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 #3 on: a Summer night » Embed

Here's my latest example. I wanted a (responsive) web page with

 :dog:  Dan I'm using this and modifying it slightly for use in my professional photography portfolio  :mark:

Do you want me to credit you in-line or anything? And is this code licensed like your site code is, as Creative Commons? I'll credit you in my About page as I do other code I use but I wasn't sure about the CC license on the stuff you've shared on Melonland as opposed to stuff you've shared on your own site  :dog:


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 CreatureMonster CreatureSquirtle!!!!
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!Visited on Melon's 10th Anniversary!
« Reply #4 on: a Summer day » Embed

Do you want me to credit you in-line or anything?

While in general almost everything original I release is CC-By-NC (i.e. free to use for non-commercial purposes, with a credit line)... I'm not convinced that anything I did here was transformative enough to be copyrightable!

So please consider it to be your choice of CC0/Public Domain: I waive any rights over it - do what you like! Credit (or don't!) if you feel like it; but do it because you want to rather than because anybody told you to!

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!Joined 2025!
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
@000 MelonLand Editor Recent Edits Tenement Arcade Want to Login or Join ? Forum Art Hub Chat Webring Web Guides Graphics Catalogue Wiki Newsletters Image Stream
Melon's Sites TamaNotchi Textures PixelSea GifyPet MoMG Ozwomp Online Loom Videos Leaky Webring Melonking
Tools Melon Software ArtHub Embed Maker ML Passports
Outlinks Frutiger Aero Forum Onio Club m15o's Web Services 32Bit Cafe iMood Webrings Internet Phone Book HTML Energy Declarations Hackers & Designers
Zap!
Minecraft: Online
Who: PrinceDora