Page MenuHomePhabricator

white border around floating image
Closed, ResolvedPublic

Description

Author: marc

Description:
This code:

[[Image:Sudan flag medium.png|right|100px|Soudan]]

causes a big white border around the picture. When the background is not white,
this can be slightly ugly. It is the case on the French Wikipédia home page
where it uses a light blue paragraph background.


Version: unspecified
Severity: trivial
URL: http://fr.wikipedia.org/wiki/Accueil

Details

Reference
bz691

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 7:00 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz691.
bzimport added a subscriber: Unknown Object (MLST).

mrnobo1024 wrote:

There are many things that have an explicit white border or background
in main.css that will clash with a darker main background:
table, legend, div.floatright, table.floatright, div.floatleft,
table.floatleft, div.thumb, div.townBox, #pagehistory li, table.diff,
td.diff-otitle, td.diff-ntitle, #preftoc li

For some of these the borders could be replaced with padding/margin
and the backgrounds removed, but others need it to stop the border of
<h2> and <hr> from overlapping them when floating.

We implemented in MediaWiki:Monobook.css on hu:

div.floatright, table.floatright {

clear: right;
float: right; 
margin: 0.5em 0 0.8em 1.4em;
position: relative;
border-width: 0;

}
div.floatleft, table.floatleft {

float: left; 
margin: 0.3em 0.5em 0.5em 0;
position: relative;
border-width: 0;

}

What is pretty interesting that if I leave out border-width then the bug is present (probably I would find it if I
would have time to browse through the whole main.css), so somewhere someone defines a white border for the floats.

Anyway, white borders should be avoided, as Goplat so rightly mentioned, and replaced by margin or padding. White
border makes look transparent pictures stupid on non-white backgrounds. Someone can use DIV style="background:
white" if a HR needs to be surpassed...

The CSS definitions for (div|table).float(left|right) add a white border. I
believe it's a workaround for some browser bug, but unfortunately I don't
know which browser (possibly IE/Mac, possibly not), and it's not
commented.

If there's a better workaround, or if it can be enabled only for the freak
browser, that would be good.

Well could anyone figure out who did that white border change in the
monobook.css? Or if anyone see a border or other problem on:

http://hu.wikipedia.org/w/index.php?title=Kezd%C5%91lap

(the current seal-of-alaska is a transparent png, if the page would change then
create a testpage with [[Image:Alaska-state-seal.png]]...)

since as I mentioned we removed the white borders (obviously, as the mentioned
png would suffer severe border-illness).

vaguerant wrote:

Couldn't the background-color for these elements be set to
"transparent"? The margins would still be there, you just
wouldn't see them.

ezyang wrote:

This can sorta be fixed by changing the MediaWiki's installation's
[[MediaWiki:Monobook.css]] to have a definition like:

.thumb {border-color:whatever-your-background-color-is;}

This is a problem on Meta, and I've motioned for a change... but I need a Sysop
to do that.

gangleri wrote:

Hallo!

Is his bug fixed?

The url is outdated; the page with timestamp "11 octobre 2004 à 19:41"
http://fr.wikipedia.org/w/index.php?title=Accueil&oldid=951499
includes actual versions of the used templates and an old screen shot is not
available.

See some (non relevant ?) tests at [[fr:Utilisateur:Gangleri/tests/bugzilla/00691]].

(In reply to comment #6)
Edward please provide a new url from Meta. Thanks in advance!

best reagrds reinhardt [[user:gangleri]]

ayg wrote:

Fixed almost two years ago in r6095.

Diffusion added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:22 AM
Diffusion added a commit: Unknown Object (Diffusion Commit).