CSS setting "background:none"
CSS setting "background:none"
It's sometimes useful to create tables which have the same background color as surrounding text, but Wikipedia's CSS gives all tables a different background color unless a style="..." attribute is used. The obvious CSS setting, "background-color:inherit" does not work with IE6 and earlier, but IE6 does understand "background: none". See here for an example. Both work in Firefox (of course!); I have not tried any other browsers. I am far from the first to "discover" this, which leads me to my point.
I strongly suggest that the m:Help:Table and/or m:Help:HTML_in_wikitext pages should say something about this. But first, we should check other browsers to see if this "trick" works in them.
Comments, questions and corrections welcome. Cheers, CWC(talk) 08:48, 29 April 2006 (UTC)
background: transparent; and it works fine in both IE7 and Firefox. —Locke Cole • t • c 09:13, 29 April 2006 (UTC)
background: none means background-image: none, whereas background: transparent means background-color: transparent. The spec says a valid declaration for background "first sets all the individual background properties to their initial values, then assigns explicit values given in the declaration". The initial value for background-color is transparent, so none and transparent are equivalent in compliant browers, and even in IE6. Since style attributes override CSS rules, background: none seems to be what we want. Cheers, CWC(talk) 18:35, 1 May 2006 (UTC)
Per CWC's request, I looked at List of indie game developers in Safari v2.0.3 (417.9.2) and saw no problems with the page render. Dread Lord CyberSkull ✎☠ 04:14, 5 May 2006 (UTC)
It's also OK in Konqueror.
I've proposed creating a new CSS class in MediaWiki:Common.css — see MediaWiki_talk:Common.css#Proposal:_class_same-bg. Discussion can continue there. Cheers, CWC(talk) 07:16, 10 May 2006 (UTC)
Let me share with you some of my hard-won knowledge of background. (One of the MediaWiki developers has called background "sneaky", and he's right.)
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.