Gallery: Use intrinsic width for gallery to center caption
authorFomafix <fomafix@googlemail.com>
Mon, 2 Nov 2015 06:39:24 +0000 (06:39 +0000)
committer[[mw:User:Fomafix]] <gerritpatchuploader@gmail.com>
Mon, 2 Nov 2015 06:39:24 +0000 (06:39 +0000)
Currently the caption is always centered between the whole width of the browser.
When there are only a few images the caption is not on top of the images.
This change shrinks the gallery to its intrinsic width. The caption is now
centered on top of the images.

This patch does not support Internet Explorer.

Bug: T29540
Change-Id: I145b120183ef151cec98aa75f030d63a191bf9ac

resources/src/mediawiki/page/gallery.css

index 3c80bbb..e834e28 100644 (file)
@@ -17,6 +17,9 @@ ul.gallery {
        margin: 2px;
        padding: 2px;
        display: block;
+       width: -moz-fit-content;
+       width: -webkit-fit-content;
+       width: fit-content;
 }
 
 li.gallerycaption {