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:
body {
background-repeat: no-repeat;
}
Practical example
In this example, we disable image background repeating using background-repeat property set to no-repeat.
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<head>
<style>
body {
height: 300px;
background-image: url("https://dirask.com/static/bucket/1631891312626-6pQmxaWAb5--background-h200px.jpg");
/* required */
background-repeat: no-repeat;
}
div {
padding: 10px;
color: white;
}
</style>
</head>
<body>
<div>Example text...</div>
</body>
</html>