Contents spilling out in non-IE browsers

Sometimes you will see text or other elements that are placed inside a <div> areĀ  spilling out of its container in non-IE browsers. Internet Explorer, unlike other browsers, IE will expand borders and background colors or images so the content doesn’t spill out of its containing element. If you do not specify “overflow:auto” Mozilla Firefox or browsers other than Internet Explorer will not get the actual height of the content inside as it increases automatically. It will remain at the height specified resulting the content spilling out as it increases dynamically. however, IE gets the actual height of the content and display it properly.

To display contents properly contained inside a specific tag you will need to specify the height or width ( depending on which way you want your content to expand) as auto.

.container
{
height: auto;
min-height: 100px;
}

or

.container
{
overflow: auto;
}

Tags: , , ,

One Response to “Contents spilling out in non-IE browsers”

  1. Sharmina says:

    Thanx for this post…it was great help

Leave a Reply

You must be logged in to post a comment.

Custom Search