Jump to content

extra bullet showing on embedded lists


DeX

Recommended Posts

I have an unordered list with an ordered list embedded like so:

 

<ul>
<li>point 1</li>
<li>
<ol>
<li>embedded point 1</li>
<li>embedded point 2</li>
</ol>
</li>
<li>point 3</li>
</ul>

 

Because the <ol> is inside a <li> tag, it adds an extra bullet at the top of the ordered list. Is this normal HTML or would it be something that is haywire inside the CSS? I didn't write the CSS so I'm basically looking for a starting point to look for how to fix this. Thanks!

Link to comment
Share on other sites

So what is showing up? Something like this?

 

* point 1

*

  - embedded point 1

  - embedded point 2

* point 3

 

Or something like this?

 

* point 1

*

  -

  - embedded point 1

  - embedded point 2

* point 3

 

If example one:

If you don't want the extra bullet, don't create the extra <li>. Put the ordered list directly into the first bullet.

 

If example two:

(I don't know why it would be doing that... I expect the output of that code to be example 1)

Link to comment
Share on other sites

You put the ordered list in a new list item tag. So of course it will show a bullet as any new list item.

 

You need to "embed" the ordered list within the original list-item tags. Remember, the original list item does NOT close until AFTER the closing embedded list tag.

 

<ul>
<li>point 1 <!-- embed ordered list INTO list-item -->
<ol>
<li>embedded point 1</li>
<li>embedded point 2</li>
</ol>
</li> <!-- NOW close original list-item -->
<li>point 3</li>
</ul>

Link to comment
Share on other sites

Thanks guys, I figured it out. I'm using Cascade as a content management system so it's modifying the code a little bit to conform to W3C standards, so it is putting the embedded list inside the parent <li> tag like you suggested. That's not causing it though, I looked through the global.css file that we have and it's adding a background bullet image to all <ol><li> tags so I just took it out. Problem solved!

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.