Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Width fixed div element same as the parent's Reply To: Width fixed div element same as the parent's

#245516
Paulie_D
Member

I think I’ve cracked this.

You have a handy max-width in play.

We can use that in our styles for .right using calc and then your width:inherit will work…I think…if we include the max-width:inherit

.right {
  position: relative;
  float: left;
  width: 25%;
  max-width: calc(50rem / 4)
}

I think we get what you are after.

http://codepen.io/Paulie-D/pen/gwPZgW