Google chrome: funny float?

For some reason, if I use the line-height property and set it a little smaller, like 13 pixels or so, the main text always gets to the bottom div with the first line.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <style>
            div.main{
                background-color:grey;
                width:500px;
                height:100px;
                text-align:justify;
                line-height:13px;   /* pfff */
            }
            div.pusher{
                float:right;
                height:40px;
            }
            div.bottom{
                float:right;
                clear:right;
                height:60px;
                width:100px;
                background-color:green;
                font-size:20px;
            }
        </style>
    </head>
    <body>
        <div class="main">
            <div class="pusher"></div>
            <div class="bottom">
                    textaaaaa aaaa aaaa
            </div>
            We have yet, many other health products, as they are all beneficiary in some way, aroma therapy products can help you to get more relaxed,
                        relieve the stress and pain, they can help with a better sleep and even protect from mosquitos.
                        Our beverages are also completely natural, and will keep you fresh and in shape!
                        Everyone knows of the coffee benefits, the juices also have vitamins and are highly beneficial.
                        In the beverage section you can also find.
        </div>
    </body>
</html>

Any ideas?

enter image description here

+3
source share
2 answers

I managed to find the answer to this error.

The height of the pusher must be a multiple of the height of the line. For instance. 39px;

In this case, he will float the text as intended. Then we can make bg transparent and place the litle add-on to make it better.

0
source

Are you trying to create a text wrapping effect around a green div?

, , .

http://css-tricks.com/all-about-floats/

EDIT:

ok div , . .

div relative div

0

All Articles