+ 1

Unordered list. 1. Is tag </li> not mandatory? 2. How to use tag <img> as <li type => in <ul> ?

https://code.sololearn.com/W7e049oWyUG7/?ref=app

27th Jul 2019, 11:07 AM
UraL
4 Respostas
27th Jul 2019, 12:29 PM
Aegon
Aegon - avatar
+ 1
1. Is tag </li> not mandatory? It is mandatory for valid HTML. In HTML5, every nonempty tag must be closed with a closing tag. li is a non-empty tag so you need to balance the opening <li> with a closing </li>. Browsers have a quirks mode for handling invalid HTML which is why you can easily be mislead into thinking that a bunch of problems are completely harmless. Quirks mode is where the browser does its best to interpret bad HTML and fix the mistakes the developer should have eliminated. Invalid code is worse than a bad practice. Your website can easily break in a different browser or newer version so fix the problems. Test validity of your HTML with a validator like https://validator.w3.org/ 2. You need to use CSS to add an image as your bullet point symbol. Here is an example: https://www.w3schools.com/cssref/tryit.asp?filename=trycss_list-style-image Even though Sololearn's course on HTML teaches some format-related attributes like type, it is much more common for developers to use CSS to format everything.
27th Jul 2019, 1:05 PM
Josh Greig
Josh Greig - avatar
+ 1
Big thanx to all
27th Jul 2019, 7:09 PM
UraL