スタイルシート(CSS)を使うと簡単に背景色を変更できます。
背景色を変更するには「background-color」を使って変更します。
スタイルシート(CSS)を使って背景色を変更する方法
背景色を変更するために「background-color」に値を設定します。
<INPUT type="text" value="ここがテキスト部分" style="background-color:#CCFFFF"><br> <INPUT type="text" value="ここがテキスト部分" style="background-color:red"><br>
こんな感じ
色名での指定は以下のパターンです。
色 | 色名 | 色 | 色名 |
aliceblue | lightgrey | ||
antiquewhite | lightpink | ||
aqua | lightsalmon | ||
aquamarine | lightseagreen | ||
azure | lightskyblue | ||
beige | lightslategray | ||
bisque | lightslategrey | ||
black | lightsteelblue | ||
blanchedalmond | lightyellow | ||
blue | lime | ||
blueviolet | limegreen | ||
brown | linen | ||
burlywood | magenta | ||
cadetblue | maroon | ||
cadetblue | mediumaquamarine | ||
chartreuse | mediumblue | ||
chocolate | mediumorchid | ||
coral | mediumpurple | ||
cornflowerblue | mediumseagreen | ||
cornsilk | mediumslateblue | ||
crimson | mediumspringgreen | ||
cyan | mediumturquoise | ||
darkblue | mediumvioletred | ||
darkcyan | midnightblue | ||
darkgoldenrod | mintcream | ||
darkgray | mistyrose | ||
darkgreen | moccasin | ||
darkgrey | navajowhite | ||
darkkhaki | navy | ||
darkmagenta | oldlace | ||
darkolivegreen | olive | ||
darkorange | olivedrab | ||
darkorchid | orange | ||
darkred | orangered | ||
darksalmon | orchid | ||
darkseagreen | palegoldenrod | ||
darkslateblue | palegreen | ||
darkslategray | paleturquoise | ||
darkslategrey | palevioletred | ||
darkturquoise | papayawhip | ||
darkviolet | peachpuff | ||
deeppink | peru | ||
deepskyblue | pink | ||
dimgray | plum | ||
dimgrey | powderblue | ||
dodgerblue | purple | ||
firebrick | red | ||
floralwhite | rosybrown | ||
forestgreen | royalblue | ||
fuchsia | saddlebrown | ||
gainsboro | salmon | ||
ghostwhite | sandybrown | ||
gold | seagreen | ||
goldenrod | seashell | ||
gray | sienna | ||
green | silver | ||
greenyellow | skyblue | ||
grey | slateblue | ||
honeydew | slategray | ||
hotpink | slategrey | ||
indianred | snow | ||
indigo | springgreen | ||
ivory | steelblue | ||
khaki | tan | ||
lavender | teal | ||
lavenderblush | thistle | ||
lawngreen | tomato | ||
lemonchiffon | turquoise | ||
lightblue | violet | ||
lightcoral | wheat | ||
lightcyan | white | ||
lightgoldenrodyellow | whitesmoke | ||
lightgray | yellow | ||
lightgreen | yellowgreen |