background-repeat: repeat;
CSS や Javascript を使用して Web サイトをタイル状に繰り返し画像で塗りつぶし、回転させるにはどうすればよいですか?
単一の画像を回転するには、CSS を使用できます。
@-webkit-keyframes spin {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
@-moz-keyframes spin {
from { -moz-transform: rotate(0deg); }
to { -moz-transform: rotate(360deg); }
}
@-ms-keyframes spin {
from { -ms-transform: rotate(0deg); }
to { -ms-transform: rotate(360deg); }
}
img#id {
-webkit-animation-name: spin;
-webkit-animation-duration: 5s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: spin;
-moz-animation-duration: 5s;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
-ms-animation-name: spin;
-ms-animation-duration: 5s;
-ms-animation-iteration-count: infinite;
-ms-animation-timing-function: linear;
}
しかし、繰り返しの画像に対してこれを行う方法がわかりません。つまり、要素として background-image にアクセスするか、 a を繰り返して、<img>
ページ全体を のような特定の画像で埋めますbackground-repeat
。
回転する単一の画像の例を次に示します。