Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
Autumn, 29 Oct 2026 - @855.14
Forum Activity: Three Stars Random | Recent Posts | Guild Recents
News: :cry: Are u having fun? Guild Events: TIME FOR HALLOWEEN CRAFTS!
Super News: ~~MelonLand's Halloween Profile Design Contest 2026~~
+  MelonLand Forum
|-+  Da Web Revival
| |-+  ✁ ∙ 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 1385 times)
IndigoGolem
Sr. Member ⚓︎
****
View Profile WWW


What's personal text?
⛺︎ My Room
RSS: RSS
OS: Debian GNU/Linux

Guild Memberships:
Artifacts:
squeezed gentlyVisited on Melon's 10th Anniversary!I got robbed by Dan Q on Melonland!Joined 2025!
« on: Summer, 19 Aug 2025 @890 » 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

Artifact Swap: spinning CDVaporfactSpiritual Stone of Firee  unus, pluriumMelonPaintMick Jagger's mouthPuzzlingCreampuffEyeSeeYou2 coinsThe fingerSeven SnailsGold OreHeptase GlyphsMoth CreatureOdd CreatureSanriosnail buddy
ribose
Sr. Member ⚓︎
****
View Profile WWWArt


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

Guild Memberships:
Artifacts:
Why did I print this artifact?Visited on Melon's 10th Anniversary!Learning to swim!Fio the HamsterAmmoniteSee A Bug Summer 2025 Participant
« Reply #1 on: Summer, 19 Aug 2025 @908 » Toggle Font 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

point & click :grin: drag & drop :grin: chips & guac

Artifact Swap: BzztWhite-Breasted NuthatchArnoldAnother WizardRing-Billed GullAmerican WoodcockAmerican RobinAmerican GoldfinchSprout LeafCache the SquirrelWebsite WizardPink DSMellohi10k:)Rainbow ConnectionSonic the HedgehogKnuckles the EchidnaE-102 GammaEmerl
IndigoGolem
Sr. Member ⚓︎
****
View Profile WWW


What's personal text?
⛺︎ My Room
RSS: RSS
OS: Debian GNU/Linux

Guild Memberships:
Artifacts:
squeezed gentlyVisited on Melon's 10th Anniversary!I got robbed by Dan Q on Melonland!Joined 2025!
« Reply #2 on: Summer, 21 Aug 2025 @667 » Embed

the defaults can be overridden with css!

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

Logged

-Indigo, Anve Ozo

Artifact Swap: spinning CDVaporfactSpiritual Stone of Firee  unus, pluriumMelonPaintMick Jagger's mouthPuzzlingCreampuffEyeSeeYou2 coinsThe fingerSeven SnailsGold OreHeptase GlyphsMoth CreatureOdd CreatureSanriosnail buddy
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 Melon
Land
Forum Art Hub Chat Webring Explore Random Recent Tenement Arcade Want to Login or Join ? Web Craft Guide Graphic Catalogue Wiki Help I'm Lost! Link Land Newsletters Image Stream Minecraft: Online
Zap!
Passport Sites tamaNOTchi Asatte Add your site?
Aero Archive Onio Cafe 32 Bit Cafe Status Cafe