Aligning divs with different dimensions horizontally.

Posted by serg555 on Stack Overflow See other posts from Stack Overflow or by serg555
Published on 2010-05-22T20:32:12Z Indexed on 2010/05/22 20:40 UTC
Read the original article Hit count: 159

Filed under:
|
|

I have a tag cloud with different font sizes.

<div>
    <a style="font-size:15px;">tag1</a>
    <a style="font-size:10px;">tag1</a>
</div>

And it looks like this:

alt text

Now I need to wrap each tag into its own div:

    <style>
        .cloud {float:left}
        .tag {float:left}
    </style>
    <div class="cloud">
        <div class="tag"><a style="font-size:15px;">tag1</a></div>
        <div class="tag"><a style="font-size:10px;">tag1</a></div>
    </div>

Which puts them all over the place. How to make them look like on the first picture?

alt text

© Stack Overflow or respective owner

Related posts about css

Related posts about css-positioning