How is XHTML different from HTML?

Опубликовано: 01 Ноябрь 2024
на канале: kvchosting
4,056
21

How is XHTML different from HTML?
XHTML is the successor of HTML.
As far as the computer languages go, HTML has a very loose syntax. It leaves a lot of room for coders to write sloppy codes. XHTML makes its syntax stricter and more consistent.
The biggest advantage of XHTML over HTML is that it doesn't just allow consistency, it requires it.
Moreover, XHTML is easier to learn than HTML.
You can take an example of a very poorly coded HTML but it still works. If you change the HTML in proper codes, it could be easily converted to XHTML. Two main parts of XHTML are still missing and those are body and html tags. After clearing up all the mess, you will see a better version of HTML. Though it is not XHTML but is very close to it.
Now, compare the older HTML to the newer one. Though XHTM is more complicated but it has its own advantages over HTML. So, XHTML is preferred.