--- title: <flex> slug: Web/CSS/flex_value tags: - CSS - CSS Data Type - CSS データ型 - Layout - Reference - Web - ウェブ - リファレンス - レイアウト translation_of: Web/CSS/flex_value --- <div>{{CSSRef}}</div> <p><a href="/ja/docs/Web/CSS">CSS</a> の <strong><code><flex></code></strong> <a href="/ja/docs/Web/CSS/CSS_Types">データ型</a> は、グリッドコンテナー内部における可変の長さです。 {{cssxref("grid-template-columns")}} や {{cssxref("grid-template-rows")}} 及びほかの関連プロパティで使われます。</p> <h2 id="Syntax" name="Syntax">構文</h2> <p><code><flex></code> データ型は {{cssxref("<number>")}} のあとに単位 <code id="fr">fr</code> が付きます。すべての CSS dimensions と同様に、数値と単位の間に空白は入れません。</p> <h2 id="Examples" name="Examples">例</h2> <pre class="brush: css">1fr /* 整数値の使用 */ 2.5fr /* 浮動小数点値の使用 */ </pre> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName("CSS Grid", "#typedef-flex", "<flex>")}}</td> <td>{{Spec2("CSS Grid")}}</td> <td>初回定義</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2> <p>{{Compat("css.types.flex")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li><a href="/ja/docs/Web/CSS/CSS_Grid_Layout">CSS グリッドレイアウト</a></li> </ul>