Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of width:-moz-available in Google Chrome

Is there an alternate way to fill the available space of nested divs in Google Chrome? Firefox's -moz-available does just that, but takes margins, paddings and scrollbars into consideration. There is no -webkit-available, though.

like image 767
Vanco Avatar asked May 10 '11 09:05

Vanco


2 Answers

Try this.

elem {
  width: 100%;
  width: -moz-available;          /* For Mozzila */
  width: -webkit-fill-available;  /* For Chrome */
  width: stretch;                 /* Unprefixed */
}
like image 195
ilgam Avatar answered Oct 05 '22 07:10

ilgam


What about this?

box-sizing: border-box;
like image 37
greim Avatar answered Oct 05 '22 08:10

greim