1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What is an "omittag"?

Discussion in 'HTML & Website Design' started by Mr.Dog, Dec 13, 2012.

  1. #1
    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...
    SEMrush
    What is "omittag" and "omittag no"?
     
    Mr.Dog, Dec 13, 2012 IP
    SEMrush
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    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.
     
    Rukbat, Dec 13, 2012 IP
  3. creativewebmaster

    creativewebmaster Active Member

    Messages:
    655
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    78
    #3
    Please check that image tag is perfect. The tag may be not close or open as it should be.
     
    creativewebmaster, Dec 14, 2012 IP
  4. Mr.Dog

    Mr.Dog Active Member

    Messages:
    859
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    60
    #4
    It is closed. So I didn't see the issue there, exactly because the tag is closed.
     
    Mr.Dog, Dec 15, 2012 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    8,447
    Likes Received:
    1,511
    Best Answers:
    221
    Trophy Points:
    515
    #5
    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...
     
    Last edited: Dec 16, 2012
    deathshadow, Dec 16, 2012 IP
  6. juliobeaupre

    juliobeaupre Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    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!
     
    juliobeaupre, Dec 22, 2012 IP
  7. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #7
    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.
     
    Rukbat, Dec 22, 2012 IP
  8. spyindiatom

    spyindiatom Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #8
    I think that is your syntax mistake....
     
    spyindiatom, Jan 2, 2013 IP
  9. sravi3661

    sravi3661 Member

    Messages:
    156
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    26
    #9
    For

    <input> tags, use

    <input ... /> ie, end it with a

    /> instead of a

    >
     
    sravi3661, Jan 3, 2013 IP