特別な効果を実現するには、JavaScript を使用して特定のタグの CSS 属性を動的に変更する必要があります。たとえば、マウスが画像の上を通過すると、画像に境界線が追加されます。コードは次のようになります。
JavaScript のスタイルの後ろの特性は何であるべきですか?
| ボックスのラベルと属性の比較 | |
|---|---|
| CSS 構文 (大文字と小文字を区別しない) | JavaScript 構文 (大文字と小文字を区別する) |
| border | border |
| border-bottom | borderBottom |
| border-bottom-color | borderBottomColor |
| border-bottom-style | borderBottomStyle |
| border-bottom-width | borderBottomWidth |
| border -color | borderカラー |
| ボーダー-左 | ボーダー左ボーダー |
| -左 | カラー |
| ボーダー | Leftカラーボーダー- | 左
| ボーダー | Leftスタイルボーダー-左幅 | ボーダーLeftWidth
| ボーダー | - |
| 右カラーボーダー | Rightカラー |
| ボーダー-右スタイル | ボーダーRightStyle |
| ボーダー-右幅ボーダー | RightWidth |
| ボーダースタイル | borderStyle |
| border-top | borderTop |
| border-top-color | borderTopColor |
| border-top-style | borderTopStyle |
| border-top-width | borderTopWidth |
| border-width | borderWidth |
| Clear | Clear |
| float | floatStyle |
| margin | margin |
| 下マージン-左 | マージン | 左
| マージン-右 | マージン |
| 右 | マージン |
| -上 | マージン | 上
| パディング | パディング |
| パディング-下 | パディング下 パディング |
| -左 パディング左 | パディング |
| -右 | パディング | 右
| パディング-上 | パディング | 上
| 色と背景のラベルと属性の比較 | |
| CSS 構文 (大文字と小文字を区別しない) | JavaScript 構文 (大文字と小文字を区別する) |
| 背景 | 背景 | 背景
| -添付ファイルの | 背景 添付ファイルの |
| 背景-色 | 背景色 |
| 背景-画像 背景 | 画像 |
| 背景-位置 | 背景 位置 |
| 背景-繰り返し | 背景 | 繰り返し
| 色 | color |
| スタイル タグと属性は、 | |
| CSS 構文 (大文字と小文字を区別しない) | と比較します。 JavaScript 構文 (大文字と小文字を区別します) |
| 表示 | 表示 |
| list-style-type | listStyleType |
| list-style-image | listStyleImage |
| list-style-position | listStylePosition |
| list-style | listStyle |
| ホワイトスペース | ホワイト | スペース
| テキスト スタイルのタグと属性は、 | |
| CSS 構文 (大文字と小文字を区別しない) | JavaScript 構文 (大文字と小文字を区別する) |
| font | font |
| font-family | fontFamily |
| font-size | fontSize |
| font-style | fontStyle |
| font-variant | fontVariant |
| font-weight | fontWeight |
| テキスト ラベルと属性の比較 | |
| CSS 構文 (大文字と小文字を区別しない) | JavaScript 構文 (大文字と小文字を区別する) |
| 文字間隔 | 文字 |
| 間隔 改行行 | 改行 |
| 高さ 行高 | さ |
| text-align | textAlign |
| text-decoration | textDecoration |
| text-indent | textIndent |
| text-justify | textJustify |
| text-transform | textTransform |
| 垂直整列 | 垂直 | 整列