Cookie

Caution


This article was published more than a year ago, there may have been developments.
Please take this into account.

The advice today is fast and (hopefully) helpful. Sometimes I happen to write some articles divided into sections. So far I have never raised the issue of assigning a sequential number to each section (as is the case with the chapters). Today I raised the issue. This procedure can be useful for example when we want to insert A small menu at the beginning, alluding to the section listed (type Wikipedia). Let's see how.

The classic HTML code for the numbered list is as follows:

<ol>
   <li>Test text 1</li>
   <li>Text Test 2</li>
</ol>

With this code will build a numbered list ordered. Suppose you have to write our text section between the section “Test text 1” and “Test text 2“. The W3C informs us that it is not allowed to enter “the case” the tag “<p>“. You must first close “<ol>”, insert the contents of “<p>”, reopen “<ol>” and reinsert “<li>”. In a nutshell start a new numbered list. To start it by the number “2” the code is “<li value="2">“. Following the example of formatting:

<ol>
   <li>Title 1</li>
</ol>
<p>This is a description.</p>
<ol>
   <li value="2">Title 2</li>
</ol>
<p>This is the second description.</p>

Let's see how it is:

  1. Headline 1

This is a description.

  1. Headline 1

This is the second description.

Not enough?

Categories: TipsWeb

TheJoe

I keep this blog as a hobby by 2009. I am passionate about graphic, technology, software Open Source. Among my articles will be easy to find music, and some personal thoughts, but I prefer the direct line of the blog mainly to technology. For more information contact me.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.