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 1055608 of inline-size

  • Revision slug: Web/CSS/inline-size
  • Revision title: inline-size
  • Revision id: 1055608
  • Created:
  • Creator: HTMLValidator
  • Is current revision? No
  • Comment fixed some CSS syntax errors

Revision Content

{{CSSRef}}{{SeeCompatTable}}

Summary

The inline-size CSS property defines the horizontal or vertical size of an element's block depending on its writing mode. It corresponds to the {{cssxref("width")}} or the {{cssxref("height")}} property depending on the value defined for {{cssxref("writing-mode")}}.

If the writing mode is vertically oriented, the value of inline-size relates to the height of the element, otherwise it relates to the width of the element. It relates to {{cssxref("block-size")}}, which defines the other dimension of the element.

{{cssinfo}}

Syntax

/* <length> values */
inline-size: 300px;
inline-size: 25em;

/* <percentage> values */
inline-size: 75%;

/* Keyword values */
inline-size: 25em border-box;
inline-size: 75% content-box;
inline-size: max-content;
inline-size: min-content;
inline-size: available;
inline-size: fit-content;
inline-size: auto;

/* Global values */
inline-size: inherit;
inline-size: initial;
inline-size: unset;

Values

The inline-size property takes the same values as the {{cssxref("width")}} and {{cssxref("height")}} properties.

Formal syntax

{{csssyntax}}

Example

HTML Content

<p class="exampleText">Example text</p>

CSS Content

.exampleText {
  writing-mode: vertical-rl;
  background-color: yellow;
  inline-size: 110px;
}

{{EmbedLiveSample("Example")}}

Specification

Specification Status Comment
{{SpecName("CSS Logical Properties", "#logical-dimension-properties", "inline-size")}} {{Spec2("CSS Logical Properties")}} Initial definition

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatNo}} {{CompatGeckoDesktop("41.0")}}[1] {{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{CompatNo}} {{CompatGeckoMobile("41.0") }}[1] {{CompatNo}} {{CompatNo}} {{CompatNo}}

[1] Available since Gecko 38, but behind the preference layout.css.vertical-text.enabled, then disabled by default.

See also

  • The mapped physical properties: {{cssxref("width")}} and {{cssxref("height")}}
  • {{cssxref("writing-mode")}}

Revision Source

<p>{{CSSRef}}{{SeeCompatTable}}</p>

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

<p>The <strong><code>inline-size</code></strong> <a href="/en-US/docs/Web/CSS" title="CSS">CSS</a> property defines the horizontal or vertical size of an element's block depending on its writing mode. It corresponds to the {{cssxref("width")}} or the {{cssxref("height")}} property depending on the value defined for {{cssxref("writing-mode")}}.</p>

<p>If the writing mode is vertically oriented, the value of <code>inline-size</code> relates to the height of the element, otherwise it relates to the width of the element. It relates to {{cssxref("block-size")}}, which defines the other dimension of the element.</p>

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

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

<pre class="brush:css">
/* &lt;length&gt; values */
inline-size: 300px;
inline-size: 25em;

/* &lt;percentage&gt; values */
inline-size: 75%;

/* Keyword values */
inline-size: 25em border-box;
inline-size: 75% content-box;
inline-size: max-content;
inline-size: min-content;
inline-size: available;
inline-size: fit-content;
inline-size: auto;

/* Global values */
inline-size: inherit;
inline-size: initial;
inline-size: unset;
</pre>

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

<p>The <code>inline-size</code> property takes the same values as the {{cssxref("width")}} and {{cssxref("height")}} properties.</p>

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

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

<h2 id="Example">Example</h2>

<h3 id="HTML_Content">HTML Content</h3>

<pre class="brush: html">
&lt;p class="exampleText"&gt;Example text&lt;/p&gt;
</pre>

<h3 id="CSS_Content">CSS Content</h3>

<pre class="brush: css">
.exampleText {
  writing-mode: vertical-rl;
  background-color: yellow;
  inline-size: 110px;
}</pre>

<p>{{EmbedLiveSample("Example")}}</p>

<h2 id="Specification">Specification</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("CSS Logical Properties", "#logical-dimension-properties", "inline-size")}}</td>
   <td>{{Spec2("CSS Logical Properties")}}</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 (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoDesktop("41.0")}}<sup>[1]</sup></td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</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>Firefox Mobile (Gecko)</th>
   <th>IE&nbsp;Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoMobile("41.0") }}<sup>[1]</sup></td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] Available since Gecko 38, but behind the preference <code>layout.css.vertical-text.enabled</code>, then disabled by default.</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>The mapped physical properties: {{cssxref("width")}} and {{cssxref("height")}}</li>
 <li>{{cssxref("writing-mode")}}</li>
</ul>
Revert to this revision