Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
June 06, 2026 - @177.55 (what is this?)
Activity rating: Four Stars Posts & Arts: 73/1k.beats Random | Recent Posts | Guild Recents
News: :wizard: You can make anything on the web! :wizard: Guild Events: Happy Pride Month Fibre Artists!

+  MelonLand Forum
|-+  Life & The Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  Images can tile and wrap to fit page width. Can other elements do that?


« previous next »
Pages: [1] Print Embed
Author Topic: Images can tile and wrap to fit page width. Can other elements do that?  (Read 1150 times)
IndigoGolem
Sr. Member ⚓︎
****
View Profile


What's personal text?
⛺︎ My Room

Artifacts:
Joined 2025!
« on: August 19, 2025 @889.58 » Embed

I'm making a trading card game kind of like Magic: The Gathering, and i have several web pages that should be filled with pictures of full cards, and text versions of the cards. This would be pretty easy if i just wanted images. <img> elements already do exactly what i want with how lines of them wrap to fit the screen, and if they're all the same size they'll tile into a nice grid.

However, i also want text versions of every card, for screen readers and people with slow internet connections. <details> might be a good way to do this, but those get put on their own lines instead of staying on the same line.

<nobr> seems like it would work until the edge of the screen, when people would start having to scroll sideways to see more cards.

I could put everything in a table but the whole point of this question is that i don't want a fixed number of cells per row.

Adding the text as alt text to the images and scrapping <details> would work, but not well unless there's a way to have formatting there. At least a line break.

In short, i need to make a bunch of <details> elements with images as the summaries display on the same line but still wrap at the end of the screen. How can i? I'm open to using CSS, i just prefer to avoid it where HTML works instead.
Logged

-Indigo, Anve Ozo %
ribose
Sr. Member ⚓︎
****
View Profile WWWArt


⚘ ⚘ ⚘ ⚘ ⚘
⛺︎ My Room
StatusCafe: ribose
iMood: ribose
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
I met Dan Q on Melonland!Fio the HamsterAmmoniteSee A Bug Summer 2025 ParticipantFirst 1000 Members!spring 2023!
« Reply #1 on: August 19, 2025 @908.34 » Embed

a series of <img> elements will be placed on the same line because (by default) they are inline elements! <details> elements get placed on new lines because (by default) they are block elements! here's w3school's page on block and inline elements.

the defaults can be overridden with css! if you want, you could use
Code
details, summary {
  display: inline;
}
to make the details and summary elements display inline. they should still wrap at the end of the page.
Logged

https://camo.githubusercontent.com/491b9e205611e603fa426d303bef52528c10ba8b96d3139e39a2e38103e5c563/68747470733a2f2f7269626f2e7a6f6e652f38387833312f736974652f7269626f73652e706e67 https://camo.githubusercontent.com/54e6ab289e4df0e4e42c9c30c886d2d7c8df708686029a1f654e2930389454b4/68747470733a2f2f7269626f2e7a6f6e652f38387833312f6d696e652f76696577736f757263652e706e67 https://camo.githubusercontent.com/f5bfa6417506fb7531aa82818e33c1ab1277070812531c09638c5aca5d2ea164/68747470733a2f2f7269626f2e7a6f6e652f38387833312f6d696e652f7777772e706e67 https://camo.githubusercontent.com/f7d9283e2ad6924bc82c68b6bd1637dfe82b9baa6362247cee489c9f8723bed8/68747470733a2f2f7269626f2e7a6f6e652f38387833312f6d696e652f7465616c2e706e67 https://camo.githubusercontent.com/66b9d37563323d2962eccea0381ded1337d1d12652da870b82e8c40d5c2e0d54/68747470733a2f2f7269626f2e7a6f6e652f73756e6461792f666973682f726174686572626566697368696e2e706e67

Artifact Swap: manstar
IndigoGolem
Sr. Member ⚓︎
****
View Profile


What's personal text?
⛺︎ My Room

Artifacts:
Joined 2025!
« Reply #2 on: August 21, 2025 @667.03 » Embed

the defaults can be overridden with css!

That is exactly what i was looking for. Thanks very much.
Logged

-Indigo, Anve Ozo %
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

Want to Login or Join ?

Minecraft: Online
Join: craft.melonking.net