背景画像の繰り返し
background-image: url(背景画像へのパス);
baclground-repeat: 値
横に繰り返しrepeat-x
縦に繰り返しrepeat-y
repeatだけだと縦横両方
例とソースは以下の通り。
<!DOCTYPE HTML> <html lang="ja"> <meta charset="UTF-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <head> <title>背景画像の練習(2)</title> <style type="text/css"> <!-- body { background-image: url(images/02.jpg); background-repeat: repeat-x; background-color: #AEE800; } --> </style> </head> <body> </body> </html>
<!DOCTYPE HTML> <html lang="ja"> <meta charset="UTF-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <head> <title>背景画像の練習(3)</title> <style type="text/css"> <!-- body { background-image: url(images/03.png); background-repeat: repeat-y; background-position: center; background-color: #AEE800; } --> </style> </head> <body> </body> </html>