Home » ★スタイルシートリファレンス

★スタイルシートリファレンス

height …… 高さを指定する
Internet Explorer4Internet Explorer5Internet Explorer5-macInternet Explorer5.5Internet Explorer6Internet Explorer7Internet Explorer8Internet Explorer9
Netscape6Netscape7Netscape8
Opera6Opera7Opera8Opera9Opera10
Firefox1Firefox2Firefox3Firefox4
Google Chrome1Google Chrome2Google Chrome3Google Chrome4Google Chrome5Google Chrome6
広告



heightプロパティは、
<TABLE>
<TD>
<IMG>
<INPUT>
<TEXTAREA>
<SELECT>
などの領域の高さを指定する際に使用します。

指定方法には、実数値にpxなどの単位をつけて指定する方法と、親ボックスに対する割合を%で指定する方法と、
状況に応じて大きさが設定されるautoを指定する方法があります。heightプロパティに負の値は指定できません。

■値

auto
状況に応じて自動設定します。これが初期値です。
数値で指定
数値にpxなどの単位をつけて指定します。pxとは1ピクセルを1とする単位で、実際に表示されるサイズは72dpiや96dpiといったモニタの解像度により変化します。
%で指定
%値で指定します。

■使用例

スタイルシート部分は外部ファイル(sample.css)に記述。

table.sample {height: 100px; background-color: #f8dce0;}
img.sample {width: 50%; height: 50%;}

HTMLソース

<html>
<head>
<link rel=”stylesheet” href=”sample.css”
type=”text/css”>
</head>
<body>

<table class=”sample”>
<tr><td>春</td><td>夏</td></tr>
<tr><td>秋</td><td>冬</td></tr>
</table>
<br>

<img border=”0″ src=”https://htmqcom1.wpengine.com/wp-content/uploads/2024/07/img002.gif” alt=”サンプルイメージ”
class=”sample”>

</body>
</html>

↓↓↓

ブラウザ上の表示

サンプルイメージ

■関連項目

width …… 幅を指定する
max-width …… 幅の最大値を指定する
min-width …… 幅の最小値を指定する
height …… 高さを指定する
max-height …… 高さの最大値を指定する
min-height …… 高さの最小値を指定する
広告



Lorem Ipsum is simply dummy text

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.