Nikk
Nikk

Reputation: 7891

Container background wont show

I cannot get the background to display for body div.grid-container.

CSS:

body div.grid-container {
    width: 100%;
    max-width: 1630px;
    height: auto;

    position: relative;
    margin: 0 auto;
    padding: 0;

    background: #d4e7ed; background-color: #d4e7ed;
}

I've tried using display: block; for all the elements. Still wont work.

Could you please Take a look here!.

The page is under construction, and it's still not responsive. So if your screen size is smaller than 1630px in width. Open it in Chrome and zoom out, using "Control" and "-".

Thanks.

Upvotes: 0

Views: 64

Answers (3)

ronnyrr
ronnyrr

Reputation: 1551

Use overflow and it will work :)

overflow: hidden;

Upvotes: 2

Brandon Taylor
Brandon Taylor

Reputation: 34553

You need to set:

overflow: auto;

to your div.

This is because the parent div contains elements that float. When elements float, they don't force the height of the parent to expand.

Upvotes: 3

Martin Vézina
Martin Vézina

Reputation: 319

It seems that all the blocks contained in your grid-container float to the left. They then don't force their container's height to adjust. You need to add a clearfix to your container.

Upvotes: 0

Related Questions