Opened 11 years ago

Closed 11 years ago

#4667 closed bug (notabug)

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.

Change History (3)

comment:1 Changed 11 years ago by xirzec

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>

comment:2 Changed 11 years ago by Scott González

Milestone: TBD1.8

comment:3 Changed 11 years ago by rdworth

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.

Note: See TracTickets for help on using tickets.