Connecting Tech Pros Worldwide Forums | Help | Site Map

floating div's and lists

James Walker
Guest
 
Posts: n/a
#1: Jul 21 '05
Hi there, i'm having a problem when a list appears immediately after a
floating div element... the bullet points or numbers appear behind the
image in both IE and Firefox... i've tried wrapping the list item in a
div and setting the margins and padding of the list but they seem to
refer to the far left of the page so if i've got two floating divs
next to each then a wider padding or margin is required ... here's my
code:

<HTML>
<HEAD>
<TITLE>CMS</TITLE>
<style>
div.divalignleft { float:left; }

div.listitem {}
</style>
</HEAD>
<body>

<div class="divalignleft">
<img src="pictures/26.jpg" width="77" height="80" />
</div>
<div class="listitem">
<ol><li>(new)</li><li>(new)</li></ol>
</div>
</body>
</HTML>

Am i being stupid??

Cheers

James

James Walker
Guest
 
Posts: n/a
#2: Jul 21 '05

re: floating div's and lists


I have discovered the answer...

div.listitem li, ol{
margin: 0px;
padding: 0px;
list-style-position: inside;
text-indent:20px;

}

james@jimw.co.uk (James Walker) wrote in message news:<8228bccf.0407081334.343966f2@posting.google. com>...[color=blue]
> Hi there, i'm having a problem when a list appears immediately after a
> floating div element... the bullet points or numbers appear behind the
> image in both IE and Firefox... i've tried wrapping the list item in a
> div and setting the margins and padding of the list but they seem to
> refer to the far left of the page so if i've got two floating divs
> next to each then a wider padding or margin is required ... here's my
> code:
>
> <HTML>
> <HEAD>
> <TITLE>CMS</TITLE>
> <style>
> div.divalignleft { float:left; }
>
> div.listitem {}
> </style>
> </HEAD>
> <body>
>
> <div class="divalignleft">
> <img src="pictures/26.jpg" width="77" height="80" />
> </div>
> <div class="listitem">
> <ol><li>(new)</li><li>(new)</li></ol>
> </div>
> </body>
> </HTML>
>
> Am i being stupid??
>
> Cheers
>
> James[/color]
Closed Thread