creating a list within a list in mediawiki

Can anyone help me figure out how to use nested numbering index in MediaWiki pages? I want it to be structured like this:

1 item "1"
2 item "2"
  2.1 item "2.1"
      2.2.1 item "2.2.1"
      2.2.2 item "2.2.2"
  2.2 item "2.2"
3 item "3"

I've come across some CSS/HTML code that works for regular HTML pages but haven't been able to adapt it for a MediaWiki page.

Thanks in advance for any assistance!

Answer №1

Here's a simple example of how you can achieve this:

<ul class="custom-list">
    <li>First item
    <li>Second item
        <ul>
            <li>Subitem 1
            <li>Subitem 2
        </ul>
    </li>           
</ul>

In your website's CSS file, you can add the following styles under a specific class name like .custom-list:

ul.custom-list { counter-reset: item }
ul.custom-list li { display: block }
ul.custom-list li:before { content: counters(item, ".") " "; counter-increment: item }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to conceal 'subnavigation' elements within Buddypress

Hey everyone, I've been looking into how to hide subnav items in a drop-down list. Can this be achieved using just CSS or will I need to write some code for it to work properly? My main goal is to have the sub nav items appear when the user hovers ove ...

The website's responsiveness is not adjusting correctly to different screen widths

When I switch to a responsive website, the background turns red at a width of "285px" even though I have set the max width to "1140px". If I use min-width, the effect doesn't show up until 256/276px. I've tried both max and min width settings, bu ...

How to overlay an image on a div element using Bootstrap styling

My goal is to have an image positioned between two separate div tags similar to a Facebook profile page: https://i.sstatic.net/sBocE.jpg I have tried solutions found here but they didn't work as expected. The image position changes when the screen s ...

Issue with Selenium and JUnit - alert not found error message

I have integrated selenium junit into my project. However, upon running the test, I encountered the following error: org.openqa.selenium.NoAlertPresentException: no such alert The expected behavior is to display a confirmation alert after clicking a butto ...

Is there a way to transform HTML special characters within files back to regular characters?

I received some source code files in an HTML output format which makes them difficult to use. For example, I have content like this: %include &quot;macros.mac&quot; It should actually look like this: %include "macros.mac" Is there a way (using ...

Validation is only effective for the initial row and fails to apply to subsequent rows. This may be due to the necessity of including the return true/false statement in my validation process

HTML PHP <div align="center"><input type="text" class="form-control" id="<?php echo $i;?>" name="r2<?php echo $i+1;?>" onblur="mvalidate2()" style="text-align: center; bo ...

What is the best way to ensure consistent font display across all devices?

I recently implemented the "spectral" Google font on my website, magpieandcapricorn.com. As I dive into responsive design, I've encountered a peculiar issue - the Spectral font displays on my iPhone but not on my husband's Android phone. How can ...

Learning to retrieve specific properties from an event target in JavaScript

Here is the code snippet I am working with: <h1 msgId = "someId"> Some text </h1> And in my code.js file, I have the following function: document.addEventListener('click', function(e) { target = e.target; }, false); I am tryin ...

How to insert space after every item generated by ng-repeat in AngularJS

I'm looking to evenly distribute elements based on this inquiry How to distribute li elements equally? I am utilizing angular with jade: ul li(ng-repeat="item in items") {{item.name}} However, ng-repeat does not create newlines after each element ...

Transmitting a chunk of HTML to a distant server following the completion of the initial form submission

// Modified // The main concern here is the most effective way to transmit a potentially large block of dynamically generated HTML to a remote server after form processing. // End Modification A client has a registration form that is shared across multi ...

Surprising <body> body movement caused by child's margin-top pushing it down

Whenever I come across HTML problems, they seem so simple that I almost feel silly asking about them. But here I am, clueless about why this issue is occurring. In the following fiddle http://jsfiddle.net/o5ee1oag/2/, the body is being pushed down by a 50 ...

"Unlocking the Power: Bringing Data from the Backend to the Frontend with ASP.NET OnClick

As I delve into the code of my current project, I find myself deciphering the work of a previous developer. Specifically, I am grappling with the usage of Eval in HTML forms. Within my HTML form, there is an onclick action that triggers the download of a ...

Show the extracted data on the following web page once it has been cleaned

I am looking to connect a python file with an HTML page using Flask application. On the first page (upload.html), the user is required to select the job field and job title from two dropdown menus. Afterwards, the user needs to upload a file containing a l ...

Troubles arise when trying to place images next to items in an unordered list

I'm trying to create an unordered list with list items that include images with bullets beside them. However, when I use a background image to achieve this, the image ends up behind the text. If I set the image as a list-style-image, it doesn't l ...

Disable javascript when using an iPad

I'm working on a website with parallax scrolling that I don't want to function on iPads. Is there a way to prevent the parallax effect from happening when the site is accessed on an iPad? Any guidance on how to disable parallax scrolling based o ...

Having trouble with aligning HTML elements with Bootstrap v4 framework

In the header, I have a container for the logo and another one for the login form. I want the logo to be on the left and the login form to be positioned at the top right corner. However, when I use float-left for the logo container and float-right for the ...

Understanding the behavior of Window.open() function with Http:// and Https:// protocols on iOS devices

I have a form that includes multiple fields along with two icons that redirect the user to a new tab. First Link <span class="uk-input-group-addon"> <a onclick="window.open('https://www.myURL.com/folder1/page_name', '_blank&apos ...

Having difficulty retrieving POST request information from an HTML form using Flask

I have been experimenting with building a website back-end using the Python library Flask. However, I keep encountering a 405 - Method not allowed error whenever I attempt to retrieve form data from a POST request in a secure manner. Right now, after a use ...

Is it possible for the `position: fixed` property to interfere with mix-blend-mode, and if so, are there

Struggling to make box-shadows cooperate with different backgrounds? The traditional method involves using mix-blend-mode and adding a pseudo element behind the main one for the effect. You can see an example of this technique here (click the + icon in th ...

Is it possible to utilize ng-show in conjunction with display:none?

Check out my plunker. I'm facing an issue where even if the ng-show is set to "false", there is always a brief display for a few milliseconds when I refresh the page. I understand that this happens because Angular hasn't loaded yet, so I tried us ...