Jump to content

Help talk:Lists

About this board

Wladek92 (talkcontribs)

MediaWiki:Common.css is a suppressed page; what to use instead ?

2 mars 2017 à 02:55 😂 discussion contributions a supprimé la page MediaWiki:Common.css (Meh, didn't work)   (remercier)

Christian 🇫🇷 FR (talk) 08:44, 17 September 2022 (UTC)

Shirayuki (talkcontribs)

MediaWiki:Common.css does not exist locally, but it has default content:

/* CSS placed here will be applied to all skins */
Reply to "Site-wide paragraph: MediaWiki:Common.css dead link"

How to write sub-numbered lists

2
Actiuinformatica (talkcontribs)
1. Fruits
 1.1. Banana
 1.2. Apple
 1.3. Orange
2. Vehicles
 2.1. Car
 2.2. Motorcycle
Dennis J au (talkcontribs)

This is an old question, but I have a suggestion on how you could implement what you have referred to as sub-numbered ordered lists.

If you can edit the wiki's .css you can achieve sub-numbered ordered lists by creating a style declaration for such lists, and then wrapping the ordered list wiki-markup in a div with the specified class. See contents of the table below.

The final example will not display properly until after you have made appropriate edits to the wiki's .css via, for example, the edit options available here: Your preferences: 'Appearance' section, under the Skin heading.

Of course, changes to your personal .css will only be reflected when you are logged in with the account of the person under which the changes were made. You would need greater access permissions to edit the site-wide .css in your site's Mediawiki:Commons.css file for everyone to be able to see the resulting sub-numbered lists.

css
.style-for-sub-numbered-lists ol {
  counter-reset: item
}
.style-for-sub-numbered-lists li {
  display: block
}
.style-for-sub-numbered-lists li:before {
  content: counters(item, ".") ". ";
  counter-increment: item;
}

wiki-markup
<div class="style-for-sub-numbered-lists">
# Fruits
## Banana
## Apple
## Orange
# Vehicles
## Car
## Motorcycle
</div>

Simulated rendering of wiki-markup.
   1. Fruits
        1.1. Banana
        1.2. Apple
        1.3. Orange
   2. Vehicles
        2.1. Car
        2.2. Motorcycle
Actual rendering of wiki-markup if you have edited the .css, for example through the links for changing your personal .css here: Your preferences: 'Appearance' section, under the Skin heading. If the css has not been changed, then the rendering will look like the classic mediawiki ordered list rendering, that is, with no sub-numbering.
  1. Fruits
    1. Banana
    2. Apple
    3. Orange
  2. Vehicles
    1. Car
    2. Motorcycle

Thanks to https://stackoverflow.com/a/10405962 'Html ordered list 1.1, 1.2 (Nested counters and scope) not working'

Reply to "How to write sub-numbered lists"

Zero-indexed ordered lists?

2
Summary by Arlo Barnes

A method question was asked and code was provided.

Arlo Barnes (talkcontribs)

How would one do

0.

1.

2.

? And can that be made default on a wiki?

Prostologin 1 (talkcontribs)

<ol start="0">

<li></li>

<li></li>

<li></li>

</ol>

There are no older topics