Skip to main content

Search and Top Navigation

#4667 closed bug (notabug)

Opened July 10, 2009 11:41PM UTC

Closed July 21, 2009 02:10AM UTC

Self-closing div tags break tabs

Reported by: xirzec Owned by:
Priority: minor Milestone: 1.8
Component: ui.tabs Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

If you have a self-closing div tag inside of tab content, all content in following divs will not render.

Example:

<div id="tabs">

<ul>

<li><a href="#tab1">Tab1</a></li>

<li><a href="#tab2">Tab2</a></li>

</ul>

<div id="tab1">

<p>tab1</p>

<div/>

</div>

<div id="tab2">

<p>tab2</p>

</div>

</div>

The text "tab2" will not be shown.

However if this is changed so the div is not self closing:

<div id="tabs">

<ul>

<li><a href="#tab1">Tab1</a></li>

<li><a href="#tab2">Tab2</a></li>

</ul>

<div id="tab1">

<p>tab1</p>

<div></div>

</div>

<div id="tab2">

<p>tab2</p>

</div>

</div>

The problem vanishes.

Attachments (0)
Change History (3)

Changed July 10, 2009 11:43PM UTC by xirzec comment:1

Whoops, forgot to do the wikiformatting:


<div id="tabs">
<ul>
  <li><a href="#tab1">Tab1</a></li>
  <li><a href="#tab2">Tab2</a></li>
</ul>
<div id="tab1">
  <p>tab1</p>
  <div/>
</div>
<div id="tab2">
  <p>tab2</p>
</div>
</div>

and

<div id="tabs">
<ul>
  <li><a href="#tab1">Tab1</a></li>
  <li><a href="#tab2">Tab2</a></li>
</ul>
<div id="tab1">
  <p>tab1</p>
  <div></div>
</div>
<div id="tab2">
  <p>tab2</p>
</div>
</div>

Changed July 21, 2009 12:27AM UTC by scottgonzalez comment:2

milestone: TBD1.8

Changed July 21, 2009 02:10AM UTC by rdworth comment:3

resolution: → invalid
status: newclosed

Self-closing DIV (<div/> instead of <div></div>) is invalid HTML. Valid self-closing HTML tags are AREA, BASE, BASEFONT, BR, HR, INPUT, IMG, LINK, and META. As such, what the browser does with <div/> is really out of our hands.