membot Posted November 17, 2010 Share Posted November 17, 2010 I've never used html/head/body tags in pages, yet w3schools says it's "required". What does that mean exactly? It obviously still works without them. Also, what's the point of using <br /> instead of <br>? Or <img src="" /> and <img src="">? Is it really more "correct" to use the extra slashes? And why, exactly, if it all works the same? Quote Link to comment Share on other sites More sharing options...
membot Posted November 17, 2010 Author Share Posted November 17, 2010 Oh sorry, didn't see that other post about the <br /> or <br> thing. But still, I'd like to know the other stuff. Quote Link to comment Share on other sites More sharing options...
trq Posted November 18, 2010 Share Posted November 18, 2010 It obviously still works without them. It might work in some browsers but could have adverse effects in others, the idea is to get your markup to validate to a specific document type. what's the point of using <br /> instead of <br>? Or <img src="" /> and <img src="">? Is it really more "correct" to use the extra slashes? The closing braces are required if you have chosen to use XHTML as your document type. Most people shouldn't be using XHTML as most servers still send XHTML documents with a mime type of text/html. So no, use a HTML doctype and you don't need the closing slashes. Quote Link to comment Share on other sites More sharing options...
haku Posted November 18, 2010 Share Posted November 18, 2010 The point of it all is to create a site that will be cross-browser compatible, as well as search engine friendly. Without a proper doctype, and the required tags, browsers have to make guesses about how a page should look. They will still create something, but each browser will guess in its own way, and fixing these issues is near impossible. On top of this, without a proper document structure, search engines also have to make guesses as to what the document is. Often they will guess wrong, and as such, your page will not rank as high on their indexes as an equivalent page that is properly structured. So if you are creating a site and don't care if it looks properly in any browser other than the one you developed it on, and don't care about the search engines, then you don't need these things. And there are many amateur sites out there that don't use them. But anyone doing it professionally will properly use the tags and make their sites cross-browser friendly. So it really just depends on what your priorities are in making your site. If it's a personal site, then it probably doesn't matter. If it's a business site, it probably does. Quote Link to comment Share on other sites More sharing options...
membot Posted November 18, 2010 Author Share Posted November 18, 2010 Ok, thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.