NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Nested Lists


Joined: 29 Mar 2018
Posts: 46
Reply with quote
Hi,
When I create nested lists, the nested list is flagged as incorrect, which then causes other end tags to be marked as incorrect. Including further on such as divs and spans etc...

Code:
<ul>
   <li>Fish</li>
   <ul>              << Flagged as Incorrect
      <li>Trout</li>
      <li>Cod</li>
      <li>Salmon</li>
   </ul>
   <li>Birds</li> << Flagged as incorrect
   <ul>             << Flagged as incorrect
      <li>Eagle</li>
      <li>Crow</li>
      <li>Swan</li>
   </ul>             
   <li>Nothing</li>
</ul>                    << Flagged as incorrect


It does though display correctly as an HTML stanza

Kind regards,

jB Cool
View user's profileFind all posts by britescSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
If you write correct HTML, validator won't complain. After all if not for that purpose, what validator is for?
As of end tags, as soon as you place a tag in an another tag that does not permit it, the outer one is considered closed. In your particular case, first nested ul closed its parent ul because ul can not be nested in ul directly.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Mar 2018
Posts: 46
Reply with quote
Hi,

Nested lists have been fully endorsed by W3C. See www / w3schools / com / html / html_list.asp
Search for nested lists

as per

Quote:

Nested HTML Lists
List can be nested (lists inside lists):

Example
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
Note: List items can contain new list, and other HTML elements, like images and links, etc.


I think there maybe there is a deficiency in the API / algorithm

Kind regards,

jB Cool
View user's profileFind all posts by britescSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Well, w3school's example is correct. Yours is not.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Mar 2018
Posts: 46
Reply with quote
Thank you for your advice.
I have now reset my code to follow EXACTLY the formula shown.
Even on a large screen I still miss the obvious.

I shall in future more more trust and faith in what PhpED is telling me!!!

Kind regards,

jB Cool
View user's profileFind all posts by britescSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
thanks to CSE Validator too

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Nested Lists
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic