...

View Full Version : ins tag



BubikolRamios
11-14-2009, 04:59 AM
I have a code like this, originaly without 'ins' tag


<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 ?

Excavator
11-14-2009, 08:29 AM
Hello BubikolRamios,
Does your code really have the missing bracket? See below, highlight in red
<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 (http://www.highdots.com/css-editor/html_tutorial/phrase/ins.html)

BubikolRamios
11-14-2009, 10:39 AM
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.



<!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.

VIPStephan
11-14-2009, 12:34 PM
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 (http://boagworld.com/technology/semantic-code-what-why-how) 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.

Scriptet
11-14-2009, 03:22 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum