Skip to content Skip to sidebar Skip to footer

Div Position Changed When Text Is Added

I am trying to make three sections using divs. Here is an image of what I currently have: When I add text to the middle div, the div shifts down like this: HTML :
Copy

You may also set it to overflow: auto if you want the container to be scrollable if the text reaches the bottom.

Another, more common approach is to use CSS's float.

You could then style your div's like this:

div {
    float: left;
    width: 625px;
    height: 1065px;
    background-color: #ececec;
    border: 1px solid #636363;
    margin: 7px0px0px15px;
}

and the HTML:

<div>Content</div>
<div>Content</div>
<div>Content</div>

See an example fiddle here.

Post a Comment for "Div Position Changed When Text Is Added"