Hello, I've just recently started learning HTML/CSS and I've been trying to teach myself sound web programming practices. I'm familiar with XML, so coding up webpages in XHTML was intuitive enough and it just seemed like a sound thing to do. However, I've been reading articles like this one and now I'm ambivalent.
My concerns with coding in either HTML and XHTML stem from the following:
- img tags do not need to be closed in HTML, and that makes sense to me. But in XHTML, img tags require a close tag which seems kind of funky. I just think it's weird to have a pair of open and close tags with nothing in between.
- p tags (as in paragraph) do not need to be closed in HTML, and that is funky to me. It makes sense to section off a paragraph between open and close tags as you would in XHTML.
These are the only basic examples I can come up with at the moment, but I'm hoping that they at least show how split I am between HTML and XHTML. So here's my actual question: Is it okay to throw in XHTML code (when I feel that it appropriately clarifies something) when I'm coding up a webpage that should be in HTML (with an HTML DTD)? I'm sure the website would look the same, but if people were to look at my source, would they think I were a terribly unprofessional coder?
Also, I've been sort of blindly looking through tutorials and guides via Google on sound web programming practices and I was wondering if you folks had any advice/resources to share with me. I really want to make sure I'm learning how to do this the right way. I would really appreciate it.
Thanks for reading!
Edit: Wow, such fast responses; you guys are awesome! So I understand that web browsers are going to be pretty lenient when it comes to this sort of stuff. My problem is then a question of vanity and how other professionals feel about writing a sort of mix of XHTML and HTML. Is strictly compliant code the way to go? I honestly just don't want to look like an idiot, haha.