i was jsut about to start on python, and i was googling around, and came to a page on begining programming, and ect. And he recomended i learned html first before any programming language, but he didnt say html, he said xhtml. So i was wondering Is HTML mandatory to move to XHTML??

Dani AI

Generated

Follow-up to : short answer — no, you do not have to learn “HTML first” to use XHTML. XHTML began as HTML expressed with XML rules, but the modern HTML living standard defines both syntaxes and recommends the HTML (HTML5) syntax for most authors. For a beginner today, learning HTML5 and semantic markup is the more practical first step. (html.spec.whatwg.org)

A couple of practical points that add to what and said: true XHTML (served with the MIME type application/xhtml+xml) is parsed as XML, so even small well-formedness errors will break the page; historically many pages were written in XHTML style but served as text/html, which causes the browser to use the HTML parser — that mismatch is a common source of surprises. If you want to use the XML route, learn how server Content-Type headers and XML parsing behave first. (developer.mozilla.org)

How to proceed: start with the MDN learning path for HTML/CSS/JS so you get semantics, structure, and the DOM fundamentals. Practice the “XHTML discipline” (consistent nesting, quoted attributes, no deprecated tags) as a coding habit — it makes your markup more robust even when you serve pages as text/html. Use the W3C Markup Validation Service while learning to catch problems early. Reserve application/xhtml+xml or strict XML workflows only when you need XML features or interoperability. (mdn2.netlify.app)

Bottom line: the strict rules behind XHTML are a useful discipline (as suggested), and was right that the syntaxes are closely related — but focus on modern HTML5 first, then adopt stricter XML/XHTML practices when your project needs them.

Recommended Answers

All 2 Replies

xhtml is basically the same as html. The only difference is the doctype and that where an element has no closing tag you end it like <img src="" alt="" />.Ofcourse, xhtml has to be coded by the html rules that html is sometimes lax at interpreting.

Check out www.w3schools.com to learn either of them.

In previous threads where this has been discussed there is no real concrete answer as to which you should learn first. xhtml is simply strict html. Personally I'd go html and then make the conversion, because you may at some point have to work with html, so it makes sense to understand it.

xhtml is just web standard compliant html.

Learning xhtml is a good way to make sure you always use proper syntax in any language you learn in the future.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.