Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1129727 of max-width

  • Revision slug: Web/CSS/@viewport/max-width
  • Revision title: max-width
  • Revision id: 1129727
  • Created:
  • Creator: johnsonjo4531
  • Is current revision? No
  • Comment

Revision Content

{{CSSRef}}

Summary

The max-width CSS descriptor specifies the maximum width of the viewport of a document defined via the {{cssxref("@viewport")}} at-rule.

By default, the width is set as close as possible to the initial viewport considering the maximum width constraint.

{{cssinfo}}

Syntax

/* Keyword value */
max-width auto;
max-width: none;

/* <length> values */
max-width: 600px;
max-width: 80em;
max-width: 15cm;

/* <percentage> value */
max-width: 75%;

Values

auto
The used value is calculated from the other CSS descriptors' values.
none
The used value is calculated from the other CSS descriptors' values.
<length>
A non-negative absolute or relative length.
<percentage>
A percentage value relative to the width of the initial viewport at zoom factor 1.0 for horizontal lengths. Must be non-negative.

Formal syntax

{{csssyntax}}

Specifications

Specification Status Comment
{{SpecName('CSS3 Device', '#descdef-viewport-max-width', '"max-width" descriptor')}} {{Spec2('CSS3 Device')}} Initial definition

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 29 (behind a flag) {{CompatNo}} 10 {{property_prefix("-ms")}} 11.10
Removed in 15
Reintroduced behind a flag in 16
{{CompatNo}}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 4.4 29 {{CompatNo}} 10{{property_prefix("-ms")}} 11.10
Removed in 15
Reintroduced behind a flag in 16
{{CompatNo}}

Revision Source

<div>{{CSSRef}}</div>

<h2 id="Summary">Summary</h2>

<p>The <strong><code>max-width</code></strong> CSS descriptor specifies the maximum width of the viewport of a document defined via the {{cssxref("@viewport")}} at-rule.</p>

<p>By default, the width is set as close as possible to the initial viewport considering the maximum width constraint.</p>

<p>{{cssinfo}}</p>

<h2 id="Syntax">Syntax</h2>

<pre class="brush: css">
/* Keyword value */
max-width auto;
max-width: none;

/* &lt;length&gt; values */
max-width: 600px;
max-width: 80em;
max-width: 15cm;

/* &lt;percentage&gt; value */
max-width: 75%;
</pre>

<h3 id="Values">Values</h3>

<dl>
 <dt><code>auto</code></dt>
 <dd>The used value is calculated from the other CSS descriptors' values.</dd>
</dl>

<dl>
 <dt><font face="Consolas, Liberation Mono, Courier, monospace">none</font></dt>
 <dd>The used value is calculated from the other CSS descriptors' values.</dd>
</dl>

<dl>
 <dt><code>&lt;length&gt;</code></dt>
 <dd>A non-negative absolute or relative length.</dd>
 <dt><code>&lt;percentage&gt;</code></dt>
 <dd>A percentage value relative to the width of the initial viewport at zoom factor 1.0 for horizontal lengths. Must be non-negative.</dd>
</dl>

<h3 id="Formal_syntax">Formal syntax</h3>

<pre class="syntaxbox">
{{csssyntax}}</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Device', '#descdef-viewport-max-width', '"max-width" descriptor')}}</td>
   <td>{{Spec2('CSS3 Device')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>29 (behind a flag)</td>
   <td>{{CompatNo}}</td>
   <td>10 {{property_prefix("-ms")}}</td>
   <td>11.10<br />
    Removed in 15<br />
    Reintroduced behind a flag in 16</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>4.4</td>
   <td>29</td>
   <td>{{CompatNo}}</td>
   <td>10{{property_prefix("-ms")}}</td>
   <td>11.10<br />
    Removed in 15<br />
    Reintroduced behind a flag in 16</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>
Revert to this revision