Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-11-2009, 01:19 PM   PM User | #1
Thatsid
New Coder

 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Thatsid is an unknown quantity at this point
Thumbs up Firefox 3 bug: ordered list bullets disappear behind floating element

Hi there fellow developers,

In Firefox 3 the following bug appears:
The bullet images of an ordered list are disappearing behind a floating div.
In IE6, IE7 and FF2 it works (and should work) fine.

See example here:
http://www.flink.nl/test/ordered-list-ff3.html

HTML code:
Code:
<div class="left">
	<img src="http://www.flink.nl/images/example/01_std_visual.gif" width="100" height="100" align="top">
</div>
<span class="spacer">
	<p>first paragraph</p>
	<ul>
		<li>first list item in the list</li>
		<li>second list item in the list</li>
		<li>third list item in the list</li>
	</ul>
</span>

<br style="clear:both">

<span class="spacer">
	<p>second paragraph</p>
	<ul>
		<li>first list item in the list</li>
		<li>second list item in the list</li>
		<li>third list item in the list</li>
	</ul>
</span>
CSS code:
Code:
.left {
	float:left;
	margin:0 15px 15px 0;
}
ul {
	margin:0 0 0 15px;
	padding:0;
}
ul li {
	padding:0 0 0 16px; 				
	background:url(http://www.flink.nl/images/example/list_item_bullet.gif) 0 6px no-repeat;
	list-style: none outside none;	
	text-indent:0;
	height:1%;
}
.spacer {
	display:block;
	padding-bottom:15px; 
}
Because it's being used in a content management system, this structure has the following conditions:
  • You cannot define any widths for any of the elements
  • The list should also align properly to the left, without standing next to the floating element.
  • it has to work with images as bullets
  • The content has to wrap around the element.
  • it's not allowed to place extra HTML-tags or classes in or around the list to influence it's behavior. All styles have to be placed

    in the standard classes for the <ul> and <li>, as you can see in the stylesheet in the header.

Thanks in advance!
Flink

Last edited by Thatsid; 02-13-2009 at 08:48 AM.. Reason: make better title
Thatsid is offline   Reply With Quote
Old 02-11-2009, 01:53 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
It's most probably due to the errors in your markup. You can't put a block level element like <p>,<div>,<ul> etc inside an inline element like <span>,<a> etc.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 02-11-2009, 02:37 PM   PM User | #3
jerry62704
Senior Coder

 
jerry62704's Avatar
 
Join Date: Oct 2007
Location: Springfield, IL
Posts: 1,042
Thanks: 9
Thanked 81 Times in 81 Posts
jerry62704 is on a distinguished road
Your span (block) is not accounting for the width of the float. Make it a float as well.
__________________
.
.
...and gladly would he learn and gladly teach

Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls
jerry62704 is offline   Reply With Quote
Old 02-13-2009, 08:43 AM   PM User | #4
Thatsid
New Coder

 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Thatsid is an unknown quantity at this point
Hi guys, you are right about the invalid markup, but that did'nt create the problem. I found the solution on an other forum:

ul {overflow:hidden}

Not quite logical, but it works!

thanks for your suggestions though!

Flink
Thatsid is offline   Reply With Quote
Reply

Bookmarks

Tags
bug, firefox3, float, list, ordered

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:35 AM.


Advertisement
Log in to turn off these ads.