CSS3 box-align プロパティ
完全な CSS3 リファレンス
例
Center the child elements of a div box by using the box-align and box-pack properties together:
div
{
width:350px;
height:100px;
border:1px solid black;
/* Firefox */
display:-moz-box;
-moz-box-orient:horizontal;
-moz-box-pack:center;
-moz-box-align:center;
/* Safari and Chrome */
display:-webkit-box;
-webkit-box-orient:horizontal;
-webkit-box-pack:center;
-webkit-box-align:center;
/* W3C */
display:box;
box-orient:horizontal;
box-pack:center;
box-align:center;
} |
Try it yourself »
More examples at the bottom of this page.
|
ブラウザ・サポート

box-align プロパティをサポートしているブラウザはありません。
Firefox supports an alternative, the -moz-box-align property.
Safari and Chrome support an alternative, the -webkit-box-align property.
定義と用法
box-align property specifies how to align the child elements of a box.
| デフォルト値: |
stretch |
| 継承: |
no |
| バージョン: |
CSS3 |
| JavaScript構文: |
object.style.boxAlign="center" |
構文
| box-align: start|end|center|baseline|stretch; |
| 値 |
説明 |
| start |
For normal direction boxes, the top edge of each child is placed along
the top of the box. For reverse direction boxes, the bottom edge of each
child is placed along the bottom of the box |
| end |
For normal direction boxes, the bottom edge of each child is placed
along the bottom of the box. For reverse direction boxes, the top edge of
each child is placed along the top of the box |
| center |
Any extra space is divided evenly, with half placed above the child and
the other half placed below the child |
| baseline |
If box-orient is inline-axis or horizontal, all children are
placed with their baselines aligned |
| stretch |
The child elements are stretched to fill the containing block |
 |
Try it Yourself - Examples |
Change the
box-align value for an element
This example demonstrates how to use a JavaScript to change the box-align values
for an element.
完全な CSS3 リファレンス
|