Navin Rauniyar
Navin Rauniyar

Reputation: 10525

max-width none for those browsers which supports viewport units

I'm designing responsive website using viewport units and now I have an issue regarding max-width. See below for example:

.container{
   width: 90%;
   max-width: 1024px;
   /*now I want to override max-width to none if viewport unit is supported*/
   max-width: none;
}

But it will override to other browsers to which doesn't support viewport units.

Upvotes: 0

Views: 44

Answers (1)

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85545

There's no way to use max-width: none; for only those browsers which supports viewport units (using css).

Though you can trick for your layout by using max-width in viewport unit like below:

.container{
   width: 90%;
   max-width: 1024px;
   max-width: 100vw;
}

Upvotes: 1

Related Questions