Повторяющиеся фоновые изображения с помощью свойства background-repeat.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>background-repeat</title>
<style>
body {
font: 14px courier;
background: #fff;
color: #000;
margin: 0;
padding: 10px;
}
p {
background-color: #ccc;
background-image: url("https://foxyforex.ru/wp-content/uploads/2023/10/opacityBg.gif");
margin: 10px;
width: 300px;
height: 300px;
float: left;
text-align: center;
}
code {
background: white;
padding: 0 15px 2px;
}
#p1 {
background-repeat: repeat;
}
#p2 {
background-repeat: no-repeat;
}
#p3 {
background-repeat: repeat-x;
}
#p4 {
background-repeat: repeat-y;
}
#p5 {
background-repeat: space;
}
#p6 {
background-repeat: round;
}
#borderCollie a {
display: block;
height: 300px;
background: white url("https://foxyforex.ru/wp-content/uploads/2023/10/opacityBg.gif") center no-repeat;
text-indent: -999em;
}
</style>
</head>
<body>
<p id="p1"><code>background-repeat: repeat;</code></p>
<p id="p2"><code>background-repeat: no-repeat;</code></p>
<p id="p3"><code>background-repeat: repeat-x;</code></p>
<p id="p4"><code>background-repeat: repeat-y;</code></p>
<p id="p5"><code>background-repeat: space;</code></p>
<p id="p6"><code>background-repeat: round;</code></p>
</body>
</html>Страницы в тему:
- Фоновые изображения
- Фоновые вложения
- Фоновые изображения (Продвинутый урок CSS)