appearanceプロパティは、ユーザーが利用するプラットフォームに応じて、
要素がその環境における標準的なUI(ユーザーインターフェース)のような外観になるよう指定する際に使用します。
appearanceプロパティをサポートするユーザーエージェント(ブラウザ)は、
icon 、window 、button 、menu 、field の5つの値をサポートする必要があるとされています。
この5つの値のそれぞれのグループの中には、さらに詳細な値が用意されていますが、
例えば、window グループの1つである dialog の値をサポートしていない場合には、window の値が適用されることになっています。
appearanceプロパティによるインターフェースのいくつかを、(CSS3ではなく)HTML4で作成すると以下のような表示となります。
appearanceプロパティの値 | HTML4で作成したインターフェースの表示例 |
---|---|
normal | ノーマル |
button | |
push-button | |
hyperlink | ハイパーリンク |
radio-button | |
checkbox | |
pop-up-menu |
|
list-menu |
|
radio-group | |
checkbox-group | |
field | |
password |
/* 主な値 */
div.appearance_normal {appearance:normal;}
div.appearance_icon {appearance:icon;}
div.appearance_window {appearance:window;}
div.appearance_button {appearance:button;}
div.appearance_menu {appearance:menu;}
div.appearance_field {appearance:field;}
/* window グループ */
div.appearance_desktop {appearance:desktop;}
div.appearance_workspace {appearance:workspace;}
div.appearance_document {appearance:document;}
div.appearance_tooltip {appearance:tooltip;}
div.appearance_dialog {appearance:dialog;}
/* button グループ */
div.appearance_push-button {appearance:push-button;}
div.appearance_hyperlink {appearance:hyperlink;}
div.appearance_radio-button {appearance:radio-button;}
div.appearance_checkbox {appearance:checkbox;}
div.appearance_menu-item {appearance:menu-item;}
div.appearance_tab {appearance:tab;}
/* menu グループ */
div.appearance_menubar {appearance:menubar;}
div.appearance_pull-down-menu {appearance:pull-down-menu;}
div.appearance_pop-up-menu {appearance:pop-up-menu;}
div.appearance_list-menu {appearance:list-menu;}
div.appearance_radio-group {appearance:radio-group;}
div.appearance_checkbox-group {appearance:checkbox-group;}
div.appearance_outline-tree {appearance:outline-tree;}
div.appearance_range {appearance:range;}
/* field グループ */
div.appearance_combo-box {appearance:combo-box;}
div.appearance_signature {appearance:signature;}
div.appearance_password {appearance:password;}
<html>
<head>
<link rel=”stylesheet” href=”sample.css”
type=”text/css”>
</head>
<body>
<h4>主な値</h4>
<div class=”appearance_normal”>normal</div>
<div class=”appearance_icon”>icon</div>
<div class=”appearance_window”>window</div>
<div class=”appearance_button”>button</div>
<div class=”appearance_menu”>menu</div>
<div class=”appearance_field”>field</div>
<h4>window グループ</h4>
<div class=”appearance_desktop”>desktop</div>
<div class=”appearance_workspace”>workspace</div>
<div class=”appearance_document”>document</div>
<div class=”appearance_tooltip”>tooltip</div>
<div class=”appearance_dialog”>dialog</div>
<h4>button グループ</h4>
<div class=”appearance_push-button”>push-button</div>
<div class=”appearance_hyperlink”>hyperlink</div>
<div class=”appearance_radio-button”>radio-button</div>
<div class=”appearance_checkbox”>checkbox</div>
<div class=”appearance_menu-item”>menu-item</div>
<div class=”appearance_tab”>tab</div>
<h4>menu グループ</h4>
<div class=”appearance_menubar”>menubar</div>
<div class=”appearance_pull-down-menu”>pull-down-menu</div>
<div class=”appearance_pop-up-menu”>pop-up-menu</div>
<div class=”appearance_list-menu”>list-menu</div>
<div class=”appearance_radio-group”>radio-group</div>
<div class=”appearance_checkbox-group”>checkbox-group</div>
<div class=”appearance_outline-tree”>outline-tree</div>
<div class=”appearance_range”>range</div>
<h4>field グループ</h4>
<div class=”appearance_combo-box”>combo-box</div>
<div class=”appearance_signature”>signature</div>
<div class=”appearance_password”>password</div>
</body>
</html>
/* 主な値 */
div.prefix_appearance_normal {
-moz-appearance:normal;
-webkit-appearance:normal;
-o-appearance:normal;
-ms-appearance:normal;
}
div.prefix_appearance_icon {
-moz-appearance:icon;
-webkit-appearance:icon;
-o-appearance:icon;
-ms-appearance:icon;
}
div.prefix_appearance_window {
-moz-appearance:window;
-webkit-appearance:window;
-o-appearance:window;
-ms-appearance:window;
}
div.prefix_appearance_button {
-moz-appearance:button;
-webkit-appearance:button;
-o-appearance:button;
-ms-appearance:button;
}
div.prefix_appearance_menu {
-moz-appearance:menu;
-webkit-appearance:menu;
-o-appearance:menu;
-ms-appearance:menu;
}
div.prefix_appearance_field {
-moz-appearance:field;
-webkit-appearance:field;
-o-appearance:field;
-ms-appearance:field;
}
/* window グループ */
div.prefix_appearance_desktop {
-moz-appearance:desktop;
-webkit-appearance:desktop;
-o-appearance:desktop;
-ms-appearance:desktop;
}
div.prefix_appearance_workspace {
-moz-appearance:workspace;
-webkit-appearance:workspace;
-o-appearance:workspace;
-ms-appearance:workspace;
}
div.prefix_appearance_document {
-moz-appearance:document;
-webkit-appearance:document;
-o-appearance:document;
-ms-appearance:document;
}
div.prefix_appearance_tooltip {
-moz-appearance:tooltip;
-webkit-appearance:tooltip;
-o-appearance:tooltip;
-ms-appearance:tooltip;
}
div.prefix_appearance_dialog {
-moz-appearance:dialog;
-webkit-appearance:dialog;
-o-appearance:dialog;
-ms-appearance:dialog;
}
/* button グループ */
div.prefix_appearance_push-button {
-moz-appearance:push-button;
-webkit-appearance:push-button;
-o-appearance:push-button;
-ms-appearance:push-button;
}
div.prefix_appearance_hyperlink {
-moz-appearance:hyperlink;
-webkit-appearance:hyperlink;
-o-appearance:hyperlink;
-ms-appearance:hyperlink;
}
div.prefix_appearance_radio-button {
-moz-appearance:radio-button;
-webkit-appearance:radio-button;
-o-appearance:radio-button;
-ms-appearance:radio-button;
}
div.prefix_appearance_checkbox {
-moz-appearance:checkbox;
-webkit-appearance:checkbox;
-o-appearance:checkbox;
-ms-appearance:checkbox;
}
div.prefix_appearance_menu-item {
-moz-appearance:menu-item;
-webkit-appearance:menu-item;
-o-appearance:menu-item;
-ms-appearance:menu-item;
}
div.prefix_appearance_tab {
-moz-appearance:tab;
-webkit-appearance:tab;
-o-appearance:tab;
-ms-appearance:tab;
}
/* menu グループ */
div.prefix_appearance_menubar {
-moz-appearance:menubar;
-webkit-appearance:menubar;
-o-appearance:menubar;
-ms-appearance:menubar;
}
div.prefix_appearance_pull-down-menu {
-moz-appearance:pull-down-menu;
-webkit-appearance:pull-down-menu;
-o-appearance:pull-down-menu;
-ms-appearance:pull-down-menu;
}
div.prefix_appearance_pop-up-menu {
-moz-appearance:pop-up-menu;
-webkit-appearance:pop-up-menu;
-o-appearance:pop-up-menu;
-ms-appearance:pop-up-menu;
}
div.prefix_appearance_list-menu {
-moz-appearance:list-menu;
-webkit-appearance:list-menu;
-o-appearance:list-menu;
-ms-appearance:list-menu;
}
div.prefix_appearance_radio-group {
-moz-appearance:radio-group;
-webkit-appearance:radio-group;
-o-appearance:radio-group;
-ms-appearance:radio-group;
}
div.prefix_appearance_checkbox-group {
-moz-appearance:checkbox-group;
-webkit-appearance:checkbox-group;
-o-appearance:checkbox-group;
-ms-appearance:checkbox-group;
}
div.prefix_appearance_outline-tree {
-moz-appearance:outline-tree;
-webkit-appearance:outline-tree;
-o-appearance:outline-tree;
-ms-appearance:outline-tree;
}
div.prefix_appearance_range {
-moz-appearance:range;
-webkit-appearance:range;
-o-appearance:range;
-ms-appearance:range;
}
/* field グループ */
div.prefix_appearance_combo-box {
-moz-appearance:combo-box;
-webkit-appearance:combo-box;
-o-appearance:combo-box;
-ms-appearance:combo-box;
}
div.prefix_appearance_signature {
-moz-appearance:signature;
-webkit-appearance:signature;
-o-appearance:signature;
-ms-appearance:signature;
}
div.prefix_appearance_password {
-moz-appearance:password;
-webkit-appearance:password;
-o-appearance:password;
-ms-appearance:password;
}
<html>
<head>
<link rel=”stylesheet” href=”sample.css”
type=”text/css”>
</head>
<body>
<h4>主な値</h4>
<div class=”prefix_appearance_normal”>normal</div>
<div class=”prefix_appearance_icon”>icon</div>
<div class=”prefix_appearance_window”>window</div>
<div class=”prefix_appearance_button”>button</div>
<div class=”prefix_appearance_menu”>menu</div>
<div class=”prefix_appearance_field”>field</div>
<h4>window グループ</h4>
<div class=”prefix_appearance_desktop”>desktop</div>
<div class=”prefix_appearance_workspace”>workspace</div>
<div class=”prefix_appearance_document”>document</div>
<div class=”prefix_appearance_tooltip”>tooltip</div>
<div class=”prefix_appearance_dialog”>dialog</div>
<h4>button グループ</h4>
<div class=”prefix_appearance_push-button”>push-button</div>
<div class=”prefix_appearance_hyperlink”>hyperlink</div>
<div class=”prefix_appearance_radio-button”>radio-button</div>
<div class=”prefix_appearance_checkbox”>checkbox</div>
<div class=”prefix_appearance_menu-item”>menu-item</div>
<div class=”prefix_appearance_tab”>tab</div>
<h4>menu グループ</h4>
<div class=”prefix_appearance_menubar”>menubar</div>
<div class=”prefix_appearance_pull-down-menu”>pull-down-menu</div>
<div class=”prefix_appearance_pop-up-menu”>pop-up-menu</div>
<div class=”prefix_appearance_list-menu”>list-menu</div>
<div class=”prefix_appearance_radio-group”>radio-group</div>
<div class=”prefix_appearance_checkbox-group”>checkbox-group</div>
<div class=”prefix_appearance_outline-tree”>outline-tree</div>
<div class=”prefix_appearance_range”>range</div>
<h4>field グループ</h4>
<div class=”prefix_appearance_combo-box”>combo-box</div>
<div class=”prefix_appearance_signature”>signature</div>
<div class=”prefix_appearance_password”>password</div>
</body>
</html>