How it Works
HTML & CSS
Does invalid HTML work?
Let's say you write invalid HTML code. Will it still work? If so, why would it work if it's invalid?
November 17, 2013, 12:38 am
That will really depend on what you mean by 'work'. If by work you simply mean display what you have done then yes it will, it won't show an error and nothing else like it may when working with another language like PHP for example. Being that HTML is a markup language there's no reason it would work any differently that it does.
November 17, 2013, 5:46 pm
If you have a image on a website in the IMG tag and no ALT attribute it is marked as invalid by
the image will still display but it is marked as invalid. The smallest mistake can make a HTML element / node / tag invalid it all depends on how invalid the HTML is to determine if it works.
December 16, 2013, 1:12 pm
It's not like the code will work or not. Whichever tags are valid they will be compiled and displayed and the ones that are incorrect will not.
January 11, 2014, 7:50 am