Jump to content

Help talk:Gallery tag

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Improvement?

[edit]

hi, traditional is a nice display:

  • could an option being added to have hover & overlay option with it ?
  • when a link= is set is there an option to open it in new windows ?

thanks for the good work ! ^_^

Frogg - 2015/04/24 11:29 Gmt+1 — Preceding unsigned comment added by 81.57.18.192 (talk) 09:30, 24 April 2015

Adjusting margins between images

[edit]

Unlike {{Multiple images}}, galleries in "packed" mode leave empty spaces between the images. Is it possible to display these images in a gallery tag without spaces between them? Jarble (talk) 16:04, 21 September 2023 (UTC)[reply]

Apparently not – there's a minimum width of 60px in the code, here: [1]. I would suggest making the gallery taller to meet this minimum width. Matma Rex talk 20:36, 26 October 2023 (UTC)[reply]

Centred caption?

[edit]

In the first example under Extended syntax, the set of images is aligned left with the caption above. However, the caption is centred within the page, not centred within the set of images. The same for a packed gallery: the gallery can be aligned left via style="text-align:left", but the caption remains centred within the page. I could enclose the gallery in a one-cell table which does constrain the caption, but that hurts. Is there any clean way to adjust the caption to be over the centre of the gallery? — GhostInTheMachine talk to me 14:23, 26 May 2024 (UTC)[reply]

Dark mode problems

[edit]

I've run into a problem where in dark mode, some images display correctly (e.g. real-life photographs) but some do not (e.g. line drawings with transparent backgrounds). An example of this can be seen at Overlapping circles grid#Gallery. Normally the solution would be to add "class=skin-invert-image" to the images that need it, but it appears the gallery tag does not support this? It needs to be applied to some images but not others, so it can't just be added for the whole gallery. I also couldn't find a template wrapper that supports this, perhaps because it's not supported in the underlying Lua module? -- Beland (talk) 21:35, 4 August 2024 (UTC)[reply]

I added that class to the gallery, and it works fine in dark mode for me, but the class applies to every image, which does not seem appropriate. There should be a way to apply that class to an individual image. – Jonesey95 (talk) 21:55, 4 August 2024 (UTC)[reply]
Yes, exactly. -- Beland (talk) 22:42, 4 August 2024 (UTC)[reply]
If it's any help, the WMF staff know about this problem already and say that they are working on it. In the meantime, the fix is to apply a non-transparent background to the image itself. – Jonesey95 (talk) 13:28, 5 August 2024 (UTC)[reply]
Excellent. -- Beland (talk) 18:03, 5 August 2024 (UTC)[reply]