Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 11:48 PM
Rod
Guest
 
Posts: n/a
Default css problem

Hi,

I would like to do an easy thing but after more than 2 weeks I cant' find a
way to do it.
Here is what I would like:
I would like to display a dynamic list of products with a photo and a title,
that's it.
But they should be within a DIV (or a span etc).
This div should have a picture as a background (to simplify it should have a
color).

impossible to do it like this:

PICTURE 1 PICTURE 2 PICTURE 3
titel1 title 2 title3
PICTURE 4 PICTURE 5 ....
titel4 title 5 ...

I did it using FLOAT, but it displays the items OUTSIDE the main div which
contain the background picture (ie, firefox, netscape)!
Acually, at the end, AFTER the main DIV.

Here is a short example which display 2 products:
<div class="listProducts">
<div class="products">
<div>
<img src="xxxx" width="200" height="149">
</div>
<div>
title1
</div>
</div>

<div class="products">
<div>
<img src="xxxx" width="200" height="149">
</div>
<div>
title1
</div>
</div>

</div>

style:
..listProducts {
background-color: #FF4500;
border: thin solid Black;
}
.products {float:left;width:33ex;}

you can see the products are outside the main DIV!!!

any idea?

thanks

Rodolphe


  #2  
Old July 20th, 2005, 11:48 PM
Johannes Koch
Guest
 
Posts: n/a
Default Re: css problem

Rod wrote:[color=blue]
> Here is a short example which display 2 products:
> <div class="listProducts">
> <div class="products">
> <div>
> <img src="xxxx" width="200" height="149">
> </div>
> <div>
> title1
> </div>
> </div>[/color]
[...][color=blue]
>
> </div>
>
> style:
> ..listProducts {
> background-color: #FF4500;
> border: thin solid Black;
> }
> .products {float:left;width:33ex;}
>
> you can see the products are outside the main DIV!!![/color]

Of course they are. Floating takes something out of the normal flow. So
the .listProducts box has no .products boxes content.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
  #3  
Old July 20th, 2005, 11:48 PM
Rod
Guest
 
Posts: n/a
Default Re: css problem

HI,

thanks for your answer.

So it explains why it does not work.

But do you have a solution to my problem?

thanks you



"Johannes Koch" <koch@w3development.de> a écrit dans le message de news:
2i5mbgFjath5U1@uni-berlin.de...[color=blue]
> Rod wrote:[color=green]
> > Here is a short example which display 2 products:
> > <div class="listProducts">
> > <div class="products">
> > <div>
> > <img src="xxxx" width="200" height="149">
> > </div>
> > <div>
> > title1
> > </div>
> > </div>[/color]
> [...][color=green]
> >
> > </div>
> >
> > style:
> > ..listProducts {
> > background-color: #FF4500;
> > border: thin solid Black;
> > }
> > .products {float:left;width:33ex;}
> >
> > you can see the products are outside the main DIV!!![/color]
>
> Of course they are. Floating takes something out of the normal flow. So
> the .listProducts box has no .products boxes content.
> --
> Johannes Koch
> In te domine speravi; non confundar in aeternum.
> (Te Deum, 4th cent.)[/color]


  #4  
Old July 20th, 2005, 11:48 PM
Els
Guest
 
Posts: n/a
Default Re: css problem

Rod wrote:
[color=blue]
> "Johannes Koch" <koch@w3development.de> a écrit dans le message de news:
> 2i5mbgFjath5U1@uni-berlin.de...
>[color=green]
>>Rod wrote:
>>[color=darkred]
>>>Here is a short example which display 2 products:[/color][/color][/color]

[snip code with floats]
[color=blue][color=green][color=darkred]
>>>you can see the products are outside the main DIV!!![/color]
>>
>>Of course they are. Floating takes something out of the normal flow. So
>>the .listProducts box has no .products boxes content.[/color]
>
> thanks for your answer.
>
> So it explains why it does not work.
>
> But do you have a solution to my problem?[/color]

Make a clearing div, after the items, but inside the
surrounding div.
Like this:
<div style="clear:both"></div>


--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -

  #5  
Old July 20th, 2005, 11:48 PM
Rod
Guest
 
Posts: n/a
Default Re: css problem

Hi,

THANKS YOU SO MUCH!

You did it!!

It works now.

Again: thanks you thanks you thanks you

Best Regards,
Rodolphe
"Els" <els.aNOSPAM@tiscali.nl> a écrit dans le message de news:
40bedf7f$0$41754$5fc3050@dreader2.news.tiscali.nl. ..[color=blue]
> Rod wrote:
>[color=green]
> > "Johannes Koch" <koch@w3development.de> a écrit dans le message de news:
> > 2i5mbgFjath5U1@uni-berlin.de...
> >[color=darkred]
> >>Rod wrote:
> >>
> >>>Here is a short example which display 2 products:[/color][/color]
>
> [snip code with floats]
>[color=green][color=darkred]
> >>>you can see the products are outside the main DIV!!!
> >>
> >>Of course they are. Floating takes something out of the normal flow. So
> >>the .listProducts box has no .products boxes content.[/color]
> >
> > thanks for your answer.
> >
> > So it explains why it does not work.
> >
> > But do you have a solution to my problem?[/color]
>
> Make a clearing div, after the items, but inside the
> surrounding div.
> Like this:
> <div style="clear:both"></div>
>
>
> --
> Els
> http://locusmeus.com/
> Sonhos vem. Sonhos vão. O resto é imperfeito.
> - Renato Russo -
>[/color]


 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles