I am adding an anchor tag inside ul and inside anchor tag I am adding li. But when I tested this on html validator it gives me error. Is there a proper way to achieve this?<
Because li should always have a parent of ul, that is the cause of your error. But I think you wanted your whole li to be clickable so this CSS style will fix it.