bevacqua
bevacqua

Reputation: 48566

CSS fixed+fluid in a single wrapper

How can I make the second div expand to the full width of the footer in this example?

I want to avoid giving a width to the second div. The first div has a fixed width of 80px

Update: so how do I make the black fox have the same height as the light gray one?

Upvotes: 2

Views: 63

Answers (1)

showdev
showdev

Reputation: 29188

Use float:left instead of display:inline-block and apply the float only to the first div.

jFiddle here

div {
  padding: 20px;
  background-color: #ccc;
}

div:first-child {
  width: 80px;
  background-color: #000;
  color: #fff;
  float:left;
}

Upvotes: 3

Related Questions