スタイルシート
前のページへ
| マージンを指定する ↓ |
|
ボックスの枠と他のボックスとのマージン(間隔)を指定します px 、% 、キーワードなどで指定margin-top: ★ 上のマージン margin-bottom: ★ 下のマージン margin-right: ★ 右のマージン margin-left: ★ 左のマージン <head>内の<style> 〜 </style>に記述
<body> 〜 </body>内に記述
サンプル |
| パディングを指定する ↓ |
|
ボックスの内容と枠とのパディング(間隔)を指定します px 、% 、キーワードなどで指定padding-top: ★ 上のパディング padding-bottom: ★ 下パディング padding-right: ★ 右のパディング padding-left: ★ 左パディング autoはブラウザが自動的に設定 <head>内の<style> 〜 </style>に記述
<body> 〜 </body>内に記述
サンプル |
| 枠線の太さを指定する ↓ |
|
ボックスの上下左右のボーダー(枠線)の太さを指定します border-top-width: ★ 上線border-bottom-width: ★ 下線 border-left-width: ★ 左線 border-rigth-width: ★ 右線 thin→細い線 medium→標準の線 thick→太い線 <head>内の<style> 〜 </style>に記述
<body> 〜 </body>内に記述
サンプル |
| 枠線の色を指定する ↓ |
|
ボックスの上下左右のボーダー(枠線)の色を指定します border-top-color: ★ 上線border-bottom-color: ★ 下線 border-left-color: ★ 左線 border-rigth-color: ★ 右線 <head>内の<style> 〜 </style>に記述
<body> 〜 </body>内に記述
サンプル |
| 枠線の種類を指定する ↓ |
|
ボックスの上下左右のボーダー(枠線)の種類を指定します border-bottom-style: ★ 下線 border-left-style: ★ 左線 border-rigth-style: ★ 右線 hidden→枠線の表示なし dotted→点線 dashed→破線 solid→実線 double→二重線 groove→へこんだように見える線 ridge→浮き上がったように見える線 inset→枠線より内側がへこんだように見える線 outset→枠線より内側が浮き上がったように見える線 <head>内の<style> 〜 </style>に記述
<body> 〜 </body>内に記述
サンプル |
| 枠線ごとに一括指定する ↓ |
|
ボックスの上下左右のボーダー(枠線)の指定を枠線ごとに一括指定します border-top: ★ ★ ★ 上線border-bottom: ★ ★ ★ 下線 border-left: ★ ★ ★ 左線 border-rigth: ★ ★ ★ 右線 <head>内の<style> 〜 </style>に記述
<body> 〜 </body>内に記述
サンプル |
| 幅と高さを指定する ↓ |
|
要素の内容が表示される領域の幅と高さを指定します width: ★ 幅height: ★ 高さ <head>内の<style> 〜 </style>に記述
<body> 〜 </body>内に記述
サンプル |