Jump to content

Help talk:Cascading Style Sheets

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

These redirect to Phabricator, and not, as far a I can see, in a useful way.

All the best: Rich Farmbrough, 17:09, 17 March 2016 (UTC).[reply]

Yeah, links like common/shared.css seem to have been obsolete since around 2014 – shared.css has been deleted for bugzilla:69277, aka phab:T71277, see commit b1dea1d (Move mediawiki.legacy.* modules from skins/common/ to resources/, 2014-08-28).
I'm not even sure what would be useful to link on the section MediaWiki core style-sheets. Some file in repository git:mediawiki/skins/Vector, perhaps? Because git:mediawiki/skins/shared doesn't have much, only one PHP file. —⁠andrybak (talk) 21:46, 21 July 2024 (UTC)[reply]
It seems that the related page Wikipedia:Catalogue of CSS classes is suffering as well, see Special:Diff/1100015725 and Special:Diff/1147963014. —⁠andrybak (talk) 21:49, 21 July 2024 (UTC)[reply]

Define CSS classes (or otherwise define general CSS) on specific page

[edit]

Hi,

On da:wiki we have a number of pages, mostly portal pages, which are formatted using HTML and CSS. These pages often have a lot of HTML elements like

 <element style="....">...</element>

where all (or almost all) the same elements (e.g. all the <td>) have the same style, making it somewhat tedious to make changes to the styles - as you then have to change a (large) number of identical style-attributes.

Now in plain HTML you can fix this by having a <style> section in the <head> or by including a CSS file - But not of these seems to be an option in wiki.

Is there some way to define a block of CSS tags or classes in a single wikipedia page - to avoid having to repeat the same style attribute over and over ?

--Honymand (talk) 18:50, 20 November 2016 (UTC)[reply]

Not for single pages. Where a style (or group of styles) is in use across a wide range of pages, we can set up suitable classes in MediaWiki:Common.css - for example the various rules for the .hlist class that was added a few years ago. --Redrose64 (talk) 23:50, 20 November 2016 (UTC)[reply]
Since 2018 it's now possible to add custom CSS to individual pages using Wikipedia:TemplateStyles. —⁠andrybak (talk) 21:31, 21 July 2024 (UTC)[reply]