Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: ins tag

  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,963
    Thanks
    120
    Thanked 76 Times in 76 Posts

    ins tag

    I have a code like this, originaly without 'ins' tag
    Code:
                  <a ...>
                    <img  src = '../img/general/bug1.png'  alt = '' />
                       <span>                   
                         <ins>
                         <div>
                           <div>
                           </div>
                         </div>
                         </ins>
                       </span>
                  </a>
    originaly validator complained:
    document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag
    Have no idea what 'ins' means, except it solves validation error, and it allso has no effect on css, like css rules does not see it.

    Any drawbacks to this ?
    Last edited by BubikolRamios; 11-14-2009 at 09:40 AM.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello BubikolRamios,
    Does your code really have the missing bracket? See below, highlight in red
    Code:
     <a ...>
                    <img  src = '../img/general/bug1.png'  alt = '' />
                       <span  <-----missing a bracket like this  >                        
                         <ins>
                         <div>
                           <div>
                           </div>
                         </div>
                         </ins>
                       </span>
                  </a>
    Span tag should not contain block level elements. That's why the validator doesn't like it.
    •The <span> tag is an inline-level element.
    •The <span> tag can only contain other inline elements like abbr, strong, or tt.
    •The <span> tag can be inside <p> tags or <div> tags.
    HTML ins tag
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,963
    Thanks
    120
    Thanked 76 Times in 76 Posts
    Ahh, no, that was a typo here on forum.

    Validator realy tells me that DIV inside SPAN is not alowed in document type (document type does not allow element ...). Tested - removed divs from span and it was ok.

    Code:
    <!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    as I gather, INS does not do any damage, so it is OK to have it there for purpose of geting html valid.
    Last edited by BubikolRamios; 11-14-2009 at 09:45 AM.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,676
    Thanks
    6
    Thanked 1,008 Times in 981 Posts
    As Excavator says, an anchor is an inline element and inline elements must not contain block elements like div or p (among others). And it doesn’t matter if your doctype is HTML 2, 3, or 4.01, strict, transitional, or frameset (or XHTML equivalents). It’s not allowed to put divs into anchors in any HTML document type.

    And no, it’s not OK to put an ins element there just to trick the validator because you’re just cheating on yourself. Technically it’s not valid to do that even if the validator doesn’t recognize it because ins doesn’t live up with its meaning in that context.

    Just move the block level elements (divs) out of the anchors and spans and look for a way to do it vice versa. Oh and use a strict doctype. Nothing else counts.

  • #5
    Regular Coder
    Join Date
    Apr 2008
    Posts
    685
    Thanks
    15
    Thanked 105 Times in 104 Posts
    Yea the immdiate fix without seeing the full code would be just to change the SPAN to a DIV and set this DIV to display:inline; within the CSS, so it would act just as the SPAN would have.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •