how to align 4 DIV's right of each other within another DIV

Posted by Michel on Stack Overflow See other posts from Stack Overflow or by Michel
Published on 2010-04-23T14:43:18Z Indexed on 2010/04/23 14:53 UTC
Read the original article Hit count: 213

Filed under:

Hi,

i want to position 4 divs next to each other, at a certain position within the parent div. So the div structure is this (i'll call the top most div the maindiv):

<div>
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
</div>

now i want to set div with text '1' at the left in the maindiv

now i want to set div with text '2' at 50 px from the left side in the maindiv

now i want to set div with text '3' at 150 px from the left side in the maindiv

now i want to set div with text '4' at 200 px from the left side in the maindiv

I think :-) i have tried ALL possible css constructs, but it didn't work, sadly.

Anyone an idea?

© Stack Overflow or respective owner

Related posts about css