<ins> tag trick to make a whole <ul> into a link

  • motionmountain
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 13, 2006
  • Posts: 51
  • Status: Offline

Post February 15th, 2008, 6:42 am

I use the <ins> tag to get a whole
block-line element (such as <ul> or <table>)
into a <a> link tag.

This trick works well, even on IE, with the table tag,
as can be seen at http://www.motionmountain.net/contents.html

but somehow something goes wrong with the <ul> tag:
see http://www.motionmountain.net/detailedcontents.html
On this page, if viewed on PC with IE, all text is showed twice.

Why?

MM
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 15th, 2008, 6:42 am

  • motionmountain
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 13, 2006
  • Posts: 51
  • Status: Offline

Post February 15th, 2008, 11:11 am

I added a table around the ul tag, and now it looks better.

It is difficult to find details on the ins tag though.


MM
  • grinch2171
  • Moderator
  • Genius
  • User avatar
  • Joined: Feb 11, 2004
  • Posts: 6330
  • Loc: Martinsburg, WV
  • Status: Offline

Post February 15th, 2008, 11:21 am

http://www.w3schools.com/tags/tag_ins.asp
  • joebert
  • Weathered
  • Genius
  • User avatar
  • Joined: Feb 10, 2004
  • Posts: 11880
  • Loc: Clearwater, FL
  • Status: Offline

Post February 15th, 2008, 12:53 pm

<ins> can be placed within block or inline elements & it can take either as a child, if you ask me the question is can elements that aren't supposed to accept block-level elements as children accept them as decendants.
Why yes, yes I am.
  • motionmountain
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 13, 2006
  • Posts: 51
  • Status: Offline

Post February 15th, 2008, 1:52 pm

Sorry, what was the second part of that sentence?

MM
  • spork
  • HB
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 5485
  • Loc: Rochester, NY
  • Status: Offline

Post February 15th, 2008, 2:03 pm

joebert wrote:
<ins> can be placed within block or inline elements & it can take either as a child

joebert wrote:
if you ask me the question is can elements that aren't supposed to accept block-level elements as children accept them as decendants.
How to Maintain Simple, Static Pages in a CakePHP Application
EEEEEEEEE! It's here!!
  • joebert
  • Weathered
  • Genius
  • User avatar
  • Joined: Feb 10, 2004
  • Posts: 11880
  • Loc: Clearwater, FL
  • Status: Offline

Post February 15th, 2008, 2:06 pm

For instance, there's the <a> element. The <a> element isn't supposed to accept a block-level element as a child.
But if the block-level element is a child of an <ins> element, technically the block-level element isn't a child of the <a> element, but it's still a decendant of the <a> element.

Which begs the question, does the type of child elements an element can contain, also apply to decendant elements ?

If a browser decides to treat decendant elements the same as child elements, using an <ins> wrapper is going to break.
If a browser decides that the allowed children only applies to direct first-generation children, then it would not break.

It seems like a situation where browsers are going to split on how they want to handle it, & I really think isn't such a good idea.
  • motionmountain
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 13, 2006
  • Posts: 51
  • Status: Offline

Post February 16th, 2008, 12:37 am

Hm, if putting a <ul> inside an <ins> inside an <a> tag
is a bad idea, what is the good way to do it?

The aim is to have the whole ul list as one large link.

MM

P.S. With an intermediate table it works also on IE
http://www.motionmountain.net/detailedcontents.html
but Opera still does not like it, as browsershots,org shows.
  • joebert
  • Weathered
  • Genius
  • User avatar
  • Joined: Feb 10, 2004
  • Posts: 11880
  • Loc: Clearwater, FL
  • Status: Offline

Post February 16th, 2008, 3:36 am

Somthing like this is less likely to be interpreted differently by multiple browsers, or in the case of IE multiple versions of the same browser.
Code: [ Download ] [ Select ]
<a>
<span>list item</span><br/>
<span>list item</span><br/>
<span>list item</span><br/>
</a>
  1. <a>
  2. <span>list item</span><br/>
  3. <span>list item</span><br/>
  4. <span>list item</span><br/>
  5. </a>


Having taken another look at the DOCTYPE, I see there's actually somthing about this situation. It seems to answer the question of whether the rule applies to decendants.
Quote:
<!--
ins/del are allowed in block and inline content, but its
inappropriate to include block content within an ins element
occurring in inline content.
-->

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 104 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.