davidb52 Posted August 26, 2012 Share Posted August 26, 2012 Hello,I'm wondering if this is allowed, and for so far I can't find the answer.For elements likemetaimgHow do you close it? Because you only need "1" element (<img src="">) not 2 like (<a href=""></a>)So:<meta charset="utf-8"><img src="images/layout/logo.png" width="266" height="100" alt="Logo"> or<meta charset="utf-8" /><img src="images/layout/logo.png" width="266" height="100" alt="Logo" /> notice the / Thanks,David Link to comment Share on other sites More sharing options...
niche Posted August 26, 2012 Share Posted August 26, 2012 (edited) Just follow the tutorials and pay attention to validation errors. For example, see: Differences Between HTML and XHTML at http://Differences Between HTML and XHTML If coding was incredibly easy, everyone would be doing it. I would use validation errors as the acid test. Edited August 26, 2012 by niche Link to comment Share on other sites More sharing options...
davidb52 Posted August 26, 2012 Author Share Posted August 26, 2012 MM, link doesn't work.But I'm using html5. http://dev.w3.org/html5/html-author/doesn't tell anything about what to use... http://www.w3schools.com/html5/tag_meta.aspin the example that you can try, they use />. While later they use "HTML5: <meta charset="UTF-8">" So what is the best way?The validator doesn't say anything about it... Link to comment Share on other sites More sharing options...
niche Posted August 26, 2012 Share Posted August 26, 2012 Here's the link: http://www.w3schools.com/tags/tag_img.asp Run some code through the validator and and you'll probably get more than you bargened for especially if it's your first time using it. Link to comment Share on other sites More sharing options...
ShadowMage Posted August 27, 2012 Share Posted August 27, 2012 It depends on which DTD you're using on your page. HTML DTDs will only accept the >, as in <img ... > while XHTML DTDs will only accept the />, as in <img ... /> HTML 5 is the exception which will support either > or /> so neither one is more correct, though some would recommend using > just because it is an HTML DTD. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now