• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 348
  • Last Modified:

HTML5 Underline word in ListItem


I would like to underline a word within a List Item.  

<ListItem>I <span style="text-decoration: underline;">am not</span> associated with organized crime...</ListItem>

Open in new window

However, when I do it as follows, I get a compiler worning that Validation (HTML5): The element 'span' cannot be nested within the element 'listitem'.      

Any suggestions on how I might do the underline and remain a good HTML5 citizen?

2 Solutions
A SPAN inside a LI is perfectly valid - you will see it used everywhere.
Can you post your rendered HTML.
Chris StanyonCommented:
Why are you using <ListItem> - you should be using <li>
RBSAuthor Commented:
Sorry, brain went to sleep - was converting old aspx form with group of listitems to chtml form and hadn't removed the old form so was getting compiler warnings...

sigh - thanks for the feedback.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now