turcospeed
turcospeed

Reputation: 23

is this a valid html- an a tag inside text?

    <li> text text  (  <a href="example.com">text</a>  )   </li>

I don't know it confuses me, an a tag inside li tag between 2 parentheses ?

Upvotes: 0

Views: 53

Answers (2)

Farzin Kanzi
Farzin Kanzi

Reputation: 3435

Html is a very flexible language and some bad codes works that you think that will never works! But your code has no problem.

And you could write that in this way:

<li> text text    <a href="example.com">(text)</a> </li>

Upvotes: 1

elementzero23
elementzero23

Reputation: 1429

Yes:

<li> text text  (  <a href="example.com">text</a>  )   </li>

If not, you wouldn't be able to do things like

<ul>
  <li>this is a list item <a href="#">with an inline link</a></li>
 </ul>

Upvotes: 1

Related Questions