Hi, I get this type of error in the W3 validator quite often: end tag for "img" omitted, but OMITTAG NO was specified Of course, I corrected by closing the <img> tag, but the rest I don't get it... What is "omittag" and "omittag no"?
It's a value in SGML. The default is yes in HTML and no in XML, so also in XHTML. Your doctype determines whether it's on or off. You can add your own SGML declaration in an HTML document (it's illegal in an XML document), most browsers will ignore it.
When omittags is no (which should only happen when using XHTML) you have to close ALL tags. Unclosed (HTML): <p>Something <li>Something else <img src="something.png" alt="something"> Closed (XHTML) normal tags: <p>Something</p> <li>Something else</li> Closed (XHTML) "empty" tags: <img src="something.png" alt="something" /> or <img src="something.png" alt="something"></img> Most people using XHTML use the shorter version, just beware that the shorter version only applies to "EMPTY" elements -- and that when the specification says "EMPTY", it means that it CANNOT hold content, not that it doesn't. What does that mean? <div></div> -- is NOT an 'EMPTY' element! -- which is why whenever someone suggests being able to do <div /> I usually call them a ignorant twit. Anything that COULD hold content isn't an 'EMPTY' element. The following tags CANNOT hold content, and as such are considered 'EMPTY'. BASE, BASEFONT, BR, FRAME, HR, IMG, INPUT, ISINDEX, LINK, META, PARAM Tags in italic are either deprecated or have no business on a modern website! There are a LOT of places in the specification where the difference between could and should is lost on people. "empty" tags is one of the best examples of that. Much of that is the fault of the language, which is like a programmer was in bed with a lawyer. That the specification wasn't even written for the majority of people using it -- web developers -- and instead was written specifically for the people writing browsers doesn't help matters one blasted bit. Forcing you to close all elements provides a consistency that makes code easier to format, easier to follow, and can prevent you from making mistakes in the first place -- it's why I prefer XHTML over HTML. Of course, you have to learn and follow rules, two things many are too impatient to do, or are too lazy to bother with. Just beware, you stick with XHTML, the *WAH, WAH, I DON'T WANNA LEARN* re-re's and the "OH GOD, IT'S TWO EXTRA CHARACTERS" asshats are going to give you a hard time about it. Tell them where to stick it! At least you're trying to use consistent formatting rules and legible code...
I too have the same problem. I tried adding extra closing div tag. I just created more errors. So I started removing closing div from the bottom-up and got two errors saying exactly the opposite thing for the same line that contains only one closing div tag!
Without seeing the entire file, we can't guess at the problem. But a closing tag without an opening tag will throw an error. So will an opening tag without a closing tag.