Help talk:Cascading Style Sheets

From Meta, a Wikimedia project coordination wiki

this article lacks a lot[edit]

This article lacks a lot! It doesn't really explain how to embed css in wiki text. Please look forward to fix that.

Yes it does lack a lot, thats why you put {{stub}} down, and help it grow. I don't see anywhere else that covers this topic.

Redefine the scope of the page[edit]

Many other websites cover CSS itself more than adequately. The Meta-Wiki isn't meant to host CSS tutorials any more than it is meant to host tutorials on HTML, or lessons on writing English; you couldn't even fit all the information that is relevant to the current headings on a single page. Rather, this page should address issues specifically related to MediaWiki, such as MediaWiki parsing bugs or disallowed attributes. One such tutorial heading is Style depending on a parameter or variable, which explains one little detail of CSS syntax.

Several of the other headings are for information easily obtained with a basic knowledge of CSS and a glance through the source code. Since the information would be different for each of the seven skins, the page would become very long. This is true for Major style blocks, and particularly so for Tips and tricks (there are books written about that specific topic).

Other sections would simply contain far more information than we could possibly fit on a single page, and that for information that anyone can easily obtain by looking through the source code for a few moments. This is especially so for Mediawiki existing styles; a quick count shows 258 classes defined for the Monobook skin alone. In addition, there are another 56 defined for print, 36 defined in the Meta-specific stylesheet, and two generated automatically by the software. This excludes classes applied to multiple selectors, so the actual number is perhaps a few dozen higher. These 352+ classes are specific to the MonoBook skin; conservatively guessing the average number of classes per skin at 250, and noting that there are seven preset skins (Cologne Blue, Nostalgia, Simple, MySkin, Classic, Chick, and MonoBook), that totals 1750 individual classes and selectors to list and explain. You could fill several pages just listing these.

Other sections are fine, with a few changes. For example, CSS in wikitext should be integrated as a brief note in the introduction (something along the lines of "You can use inline CSS as you would on any other webpage, or use classes defined in the relevant skin's stylesheet"). Supported Elements should instead focus on disallowed attributes (not elements), since nearly all CSS attributes are supported.

That would eliminate most of the text on this page, but once fleshed out it would be a useful little page for users looking for information on using CSS with MediaWiki. Those wishing to learn CSS itself could follow a link to a comprehensive, useful CSS resource. // [admin] Pathoschild (talk/map) 04:19, 1 August 2006 (UTC)Reply[reply]

That link is dead, works. Perhaps some content can be moved to Wikipedia. Looking in the HTML source code is useful, but in addition it is good if the classes used in MediaWiki are explained. The fact that there are many classes is no reason not to add info about them, let alone a reason to delete such info.--Patrick 09:58, 1 August 2006 (UTC)Reply[reply]
Where did you get the idea that anyone was intending this to become a CSS tutorial? Is such a (re)definition really necessary?. Granted, the page needs (a lot of) work, but is setting up a roadmap really the best allocation of editorial resources. It seems to me that tackling issues as they come along has worked well in the past.
If you are intent on creating a roadmap, how about loosing a bit of the verbosity and boiling it down to:
  • Information specific to MediaWiki.
  • Information particularly useful in wiki markup.
I think we can agree on the former, but the latter may be disputed. My argument for it, is that if users were to learn HTML and CSS, we wouldn't have wiki markup. There is quite a big gap from wiki to "web" and I think it would be very useful to bridge it.
If you still disagree, how about settling on sectioning the latter group off or moving to a different page so that it is available, but not overshadowing the important stuff. --Swift 10:17, 1 August 2006 (UTC)Reply[reply]
Don't Delete. I don't think this should be deleted, just improved as per the other comments. The preceding unsigned comment was added by (talk • contribs) 19:05, 12 August 2006 (UTC)

How to embed CSS?[edit]

I'm looking to add a class for a set of wiki's that I'm writing.

I'd like to add a table which is a genuine table. I'd like to centre the text in the TD and have a gray background on the TH. In HTML CSS, I'd define a class in a <style></style> in the header, that defines ".myTable td" and ".myTable th". How do I do it in Wiki?

I know I could add a style= to every TD and TH but this would be cumbersome.

Different question but same anwser (I think): is there any ways to include :before pseudo element (I need it for numbering in a template) 23:02, 3 March 2007 (UTC)Reply[reply]

page no found[edit]

MediaWiki in general, per skin: et

Try --Werdan7T @ 03:00, 17 June 2008 (UTC)Reply[reply]
Ah, I see what you mean. Thanks for letting us know, I've fixed it.--Werdan7T @ 03:04, 17 June 2008 (UTC)Reply[reply]