Float: left, div falling by width of div

3

I'm having a problem with float:left; : for a width greater than the page the div drops, but I wanted it to continue to div earlier.

HTML:

<div id="menu" class="menu">
    MENU
</div>
<div class="resto">
    RESTO DO CONTEUDO
</div>

CSS:

.menu {
    width: 250px;
    float: left;
    position: blocked;
    background-color: blue;
}

.resto {
    background-color: #ccc;
    width: 100%;
    float: right;
}

JSFiddle Result .

    
asked by anonymous 05.03.2014 / 16:53

2 answers

3

You do not need overflow: hidden; , removing width and float: right; it already goes to the same line.

It would be nice if you put a width in the two div's and leave them in a block to avoid conflicts with elements below them.

See the code in JSFiddle

This creates blocks in your code and prevents elements below them from "breaking" the page.

Good studies!

    
06.03.2014 / 23:00
2

As far as I'm concerned, the% wc% fixed on the line. You lacked the div property that does this.

Fiddle edited

    
05.03.2014 / 16:58