Trimax Posted April 7, 2014 Share Posted April 7, 2014 (edited) What is the correct format for the non-pair tag like img or link in HTML5? In some sites I've read <img src="" />, with the slash at final, but in other sites (like w3schools) the format is <img src="" > without the slash. It works in both cases but I think there should be only one right way. Thanks! Edited April 7, 2014 by Trimax Link to comment Share on other sites More sharing options...
Ingolme Posted April 7, 2014 Share Posted April 7, 2014 XHTML closes empty elements with a slash, HTML does not. The same goes for elements such as <br />, <link /> and <input type="button" /> 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