EN
CSS - disable image background repeating
0 points
In this article, we would like to show you how to disable image background repeating using CSS.
Quick solution:
xxxxxxxxxx
1
body {
2
background-repeat: no-repeat;
3
}
In this example, we disable image background repeating using background-repeat
property set to no-repeat
.
xxxxxxxxxx
1
2
<html>
3
<head>
4
<style>
5
6
body {
7
height: 300px;
8
background-image: url("https://dirask.com/static/bucket/1631891312626-6pQmxaWAb5--background-h200px.jpg");
9
10
/* required */
11
background-repeat: no-repeat;
12
}
13
14
div {
15
padding: 10px;
16
color: white;
17
}
18
19
</style>
20
</head>
21
<body>
22
<div>Example text...</div>
23
</body>
24
</html>