user3143131
user3143131

Reputation: 31

Background color won't apply to all of the div

I'm pretty sure the problem must lie in my CSS. I'm pretty sure the HTML is fine. If I put height 100% it works in the .info but I don't want to do that.

.info {
    width:820px;
    margin:auto;
    background-color:#e2e2e2;
}

.info img { 
    float:left;
    padding-top:6px;
    padding-left:5px;
}

.info article   {
    padding-left:5px;
    font-family:sans-serif;
    text-indent:15px;
    width:600px;
    float:right;
    background-color:#e2e2e2;
}

Upvotes: 2

Views: 86

Answers (3)

loveNoHate
loveNoHate

Reputation: 1547

Or try this

.info {
  display: inline-block;
}

Upvotes: 0

CRABOLO
CRABOLO

Reputation: 8793

try this

.info {
   float: left;
}

Upvotes: 0

Naele
Naele

Reputation: 530

You have to clear floats..The easy way is to add overflow: hidden in .info

Or add the class="cf" in .info

.cf:before,
.cf:after {
   display: table;
   content: "";
}

.cf:after {
   clear: both;
}

Upvotes: 2

Related Questions