Why not just use <p> </p> and then <br /> for each list ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why not just use <p> </p> and then <br /> for each list ?

1st Sep 2020, 4:24 PM
Solanda Okojie
Solanda Okojie - avatar
8 Answers
+ 7
Solanda Okojie both are different <p> is used for writing paragraphs While <ol> is used for ordered list First will give output as 1.red 2. blue While second one will give output as red blue
1st Sep 2020, 4:44 PM
Harsh
Harsh - avatar
+ 3
Solanda Okojie It's totally different, see you r using the list tag, to list all the items for your use, just like how u list out the set of things to be done for a day! Remember we always start our list by numbers ,or for a mere purpose a bullet style, which are ordered and unordered lists respectively, traditional <p>item1<br/>item2</p>will not make u a list, instead u are fixing it artificially, Hope u understood :) https://code.sololearn.com/WxvZ6ApqdoYL/?ref=app
1st Sep 2020, 4:40 PM
RuntimeERROR
RuntimeERROR - avatar
+ 1
Instead of writing it like this.- <ol> <li>red</li> <li>blue</li> </ol> Why not like this ?- <p>red <br /> blue <br /></p>
1st Sep 2020, 4:34 PM
Solanda Okojie
Solanda Okojie - avatar
+ 1
Thanks...Netha_r2071 it's better to use the list tag
1st Sep 2020, 4:45 PM
Solanda Okojie
Solanda Okojie - avatar
+ 1
Yes :))
1st Sep 2020, 4:45 PM
RuntimeERROR
RuntimeERROR - avatar
+ 1
Thanks Harsh [ Inactive ] I just ran it...and it gave me that
1st Sep 2020, 4:46 PM
Solanda Okojie
Solanda Okojie - avatar
0
Solanda Okojie can u elaborate ur ques?
1st Sep 2020, 4:28 PM
RuntimeERROR
RuntimeERROR - avatar
0
Lists have slightly more semantic meaning.
2nd Sep 2020, 2:39 AM
Sonic
Sonic - avatar