aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/html/attributes/size
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/html/attributes/size
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/html/attributes/size')
-rw-r--r--files/ja/web/html/attributes/size/index.html76
1 files changed, 76 insertions, 0 deletions
diff --git a/files/ja/web/html/attributes/size/index.html b/files/ja/web/html/attributes/size/index.html
new file mode 100644
index 0000000000..3722ecb051
--- /dev/null
+++ b/files/ja/web/html/attributes/size/index.html
@@ -0,0 +1,76 @@
+---
+title: 'HTML 属性: size'
+slug: Web/HTML/Attributes/size
+tags:
+ - Attribute
+ - HTML
+ - Input
+ - Reference
+ - Select
+translation_of: Web/HTML/Attributes/size
+---
+<p>{{HTMLSidebar}}</p>
+
+<p class="summary"><strong><code>size</code></strong> 属性は、 {{htmlelement('input')}} 要素の幅と {{htmlelement('select')}} 要素の高さを定義します。 <code>input</code> については、 <code>type</code> 属性が {{HTMLElement("input/text", "text")}} または {{HTMLElement("input/password", "password")}} の場合は文字数です。これは 0 以上の整数でなければなりません。 <code>size</code> が指定されていないか、無効な値が指定された場合、入力欄にサイズが宣言されず、そのフォームコントロールはユーザーエージェントに基づいた既定の幅になります。 CSS が幅に影響を与えるプロパティで要素を対象としている場合は、 CSS が優先されます。</p>
+
+<p><code>size</code> 属性は制約検証には影響しません。</p>
+
+<h2 id="Examples" name="Examples">例</h2>
+
+<p>一部の入力型で <code>size</code> を指定すると、入力欄の幅を制御することができます。 select に size を追加すると、閉じた状態のときにいくつの選択肢が見えるかを定義します。</p>
+
+<pre class="brush: html notranslate">&lt;label for="fruit"&gt;Enter a fruit&lt;/label&gt; &lt;input type="text" size="15" id="fruit"&gt;
+&lt;label for="vegetable"&gt;Enter a vegetable&lt;/label&gt; &lt;input type="text" id="vegetable"&gt;
+
+&lt;select name="fruits" size="5"&gt;
+ &lt;option&gt;banana&lt;/option&gt;
+ &lt;option&gt;cherry&lt;/option&gt;
+ &lt;option&gt;strawberry&lt;/option&gt;
+ &lt;option&gt;durian&lt;/option&gt;
+ &lt;option&gt;blueberry&lt;/option&gt;
+&lt;/select&gt;
+
+&lt;select name="vegetables" size="5"&gt;
+&lt;option&gt;carrot&lt;/option&gt;
+&lt;option&gt;cucumber&lt;/option&gt;
+&lt;option&gt;cauliflower&lt;/option&gt;
+&lt;option&gt;celery&lt;/option&gt;
+&lt;option&gt;collard greens&lt;/option&gt;
+&lt;/select&gt;</pre>
+
+<p>{{EmbedLiveSample('Examples', '100%', 200)}}</p>
+
+<h2 id="Specifications" name="Specifications">仕様書</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">仕様書</th>
+ <th scope="col">状態</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'input.html#attr-input-size', 'size attribute')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5.1', 'input.html#attr-size-accept', 'size attribute')}}</td>
+ <td>{{Spec2('HTML5.1')}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
+
+<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div>
+
+<p>{{Compat("html.elements.attribute.size")}}</p>
+
+<h2 id="See_also" name="See_also">関連情報</h2>
+
+<ul>
+ <li><code><a href="/en-US/docs/Web/HTML/Attributes/maxlength">maxlength</a></code></li>
+ <li><code><a href="/en-US/docs/Web/HTML/Attributes/minlength">minlength</a></code></li>
+ <li><code><a href="/en-US/docs/Web/HTML/Attributes/pattern">pattern</a></code></li>
+</ul>