Cookie

The advice today is fast and (hopefully) helpful. Sometimes I happen to write some articles divided into sections. Fin’ora non mi sono mai posto il problema di assegnare 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 un piccolo menù all’inizio dell’articolo alluding to the section listed (type Wikipedia). Let's see how.

Il codice HTML classico per l’elenco numerato è il seguente:

<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">“. Di seguito l’esempio di formattazione:

<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.

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 *