Friday 9 October 2015

Test of Ordered List

Just another test post, this time to see if I can make an Ordered List where the numbers are in boldface.


  1. test1
  2. test2

Okay, I figured it out. To do this in Blotspot, simply insert this code, into the "HTML" view mode of your blog post:
<style type="text/css">
ol { font-weight: bold }
ol lspan { font-weight: normal }
</style>

<br />
<ol start="0">
<li><lspan>test1</lspan></li>
<li><lspan>test2</lspan></li>
</ol>
Then switch back to the "Compose" view, and go in and replace the test1 and test2 text with what you want in your list, and then you can use the Return key to add additional numbered entries to your list, and they should automatically be with boldfaced numbers as well.

It'll look wrong in the "Compose" view mode, but will actually work when you view the blog post normally (presumably in all browsers and on all devices). Note, though, that the CSS change causes all ordered lists in that blog post to be all bold, both the list entry numbers and the text of each list entry, which is why you must use the <lspan> tags to enable and disable the non-bold text to avoid this, in each list. (I don't know of a way to make it so that you can also have ordered lists with non-bold numbers, but personally I prefer ordered lists with bold numbers so it's fine with me.)

Okay, testing some more it's actually somewhat fiddly to use, and I've found that I sometimes have to go back into the "HTML" view mode and insert the <lspan> and </lspan> tags manually, perhaps especially if I copy/paste stuff while in the "Compose" view mode. But it does work!

The start = "0" is a silly little thing I made for one of the Factorio UnOfficial FAQ posts, making the list start with 0 instead of with 1. If you just omit it (use <ol>), then the ordered list will start with 1 as usual.

Peter34

No comments:

Post a Comment

Hi, please keep comments on-topic in terms of the specific blog post you're replying to. Also keep in mind, this is my "mixed/random stuff"-blog; if you want "theme", go for the other ones.