+ 5

How to add ordering to definition list in HTML?

I was wondering if we can add ordering to definition list, similar to ordered list? You may suggest using css, but I am interested if there is a trick in HTML itself for doing that.

6th Aug 2017, 4:27 PM
Vahid Shirbisheh
Vahid Shirbisheh - avatar
4 Respostas
+ 4
what you are suggesting is a useful technic but it doesn't answer my question.
6th Aug 2017, 5:10 PM
Vahid Shirbisheh
Vahid Shirbisheh - avatar
+ 3
Definition lists are not designed to be ordered (neither numbered), basically... Anyway, <dl>, <dt> and <dd> elements can have or can be nested and mixed with <ol> (or even <ul>, obviously) elements: <dl> <dt>title</dt> <ol> <li><dd>definition</dd></li> <li><dd>definition</dd></li> <li><dd>definition</dd></li> </ol> </dl> <dl> <ol> <li> <dt>title</dt> <dd>definition</dd> </li> <li> <dt>title</dt> <dd>definition</dd> </li> <li> <dt>title</dt> <dd>definition</dd> </li> </ol> </dl> You have just to use Css to design it at your convenience ;P
7th Aug 2017, 8:57 AM
visph
visph - avatar
0
You can use list-style-type in css to style your list: https://www.w3schools.com/cssref/pr_list-style-type.asp I hope that can help you
6th Aug 2017, 5:00 PM
Αητοιπe
Αητοιπe - avatar
0
Sorry, if think I didn't understand your question, you can try with the before selector example : <ul> <li>MENU</li> </ul> and then use a ul li:before in your css and stylised it to make what you want (like a point on the left of the li for example)
6th Aug 2017, 5:14 PM
Αητοιπe
Αητοιπe - avatar