Jump to content

Anchor after last list item


fierdor

Recommended Posts

Is the following HTML wrong?

 

<ul style="text-align:center;" id="listhere">
<li id="rel1"><a href="#">3.4.1</a></li>
<div id="rel1content" style="display:none;">
<a href="#">Item 1</a>
<a href="#">Item 2</a>
</div>
<li id="rel2"><a href="#">3.4.2</a></li>
<div id="rel2content" style="display:none;">
<a href="#">Item 1</a>
<a href="#">Item 2</a>
</div>
</ul>

 

The strange thing is the div after rel1 shows up.....But the div after rel2 doesnt show up...

However instead of

 

<div id="rel2content" style="display:none;">
<a href="#">Item 1</a>
<a href="#">Item 2</a>
</div>

 

if I use this:

 

<div id="rel2content" style="display:none;">
Item 1
Item 2
</div>

 

It works...Some rule I am violating??

Link to comment
Share on other sites

Hi,

 

I'm only seeing:

  • 3.4.1
  • 3.4.2

 

While both div's are hidden.

However, I think you should us an UL instead of a DIV.

Like this:

<ul style="text-align:center;" id="listhere">
<li id="rel1"><a href="#">3.4.1</a>
	<ul id="rel1content" style="display:none;">
		<li><a href="#">Item 1</a></li>
		<li><a href="#">Item 2</a></li>
	</ul>
</li>	
<li id="rel2"><a href="#">3.4.2</a>
	<ul id="rel2content" style="display:none;">
		<li><a href="#">Item 1</a></li>
		<li><a href="#">Item 2</a></li>
	</ul>
</li>
</ul>

 

I hope this helps,

Joe

 

Link to comment
Share on other sites

<ul style="text-align:center;" id="listhere">
  <li id="rel1">
    <a href="#">3.4.1</a>
    <div id="rel1content" style="display:none;">
      <a href="#">Item 1</a>
      <a href="#">Item 2</a>
    </div>
  </li>
  <li id="rel2">
    <a href="#">3.4.2</a>
    <div id="rel2content" style="display:none;">
      <a href="#">Item 1</a>
      <a href="#">Item 2</a>
    </div>
  </li>
</ul>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.