Forum Moderators: not2easy

Message Too Old, No Replies

Three images in a div in an L shape ?

         

Digmen1

8:16 pm on Jun 19, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi Guys

I have a div in which I want to place three images

One on one row at the top left, The other two on the second row side by side. So that the three images form an L shape.

Any suggestions on the best techniques to achieve this ?

marcel

8:24 pm on Jun 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Digmen1,

You could try the following:

- place the first image (float it left or right if you want)

- the next image will need a clear: both; (if you've floated the first image float this one as well)

- and the next image will only need the same float as the two above it (if they have one)

* this is off the top of my head, and untested

swa66

9:31 pm on Jun 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Images are by default inline elements.


<div>
<img src="1-1.jpg" alt="mandatory" />
<br />
<img src="2-1.jpg" alt="mandatory" />
<img src="2-2.jpg" alt="mandatory" />
</div>

No need for anything fancy ...

DrDoc

9:45 pm on Jun 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The first image you want to specify
vertical-align: bottom
on, to avoid a gap between the first and second line.

marcel

4:56 am on Jun 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No need for anything fancy ...

Stupid of me... I got so caught up in trying to achieve this with CSS I completely overlooked the fact that styling is practically unnecessary... :)

Digmen1

5:42 am on Jun 20, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks guys

Yes swa66 that worked perfectly !