CSS Background Shorthand:-
Shorthand property uses when you want to become a professional programmer. It helps you to add single-line code with many properties. This is called a short-hand property.
In the below example, we use a typical coding technique.
<!DOCTYPE html>
<html>
<head>
<style>
body{background-image: url("img_tree.png")
background-repeat: no-repeat;
background-color: #ffffff;
background-position: right-top;
}
</style>
</head>
<body>
<h1> CSS Background </h1>
<p> In this code we use typical coding techniques.</p>
</body>
</html>
Try this code for a better experience
In the below example, we use the shorthand technique using only background property.
<!DOCTYPE html>
<html>
<head>
<style>
body{background: #ffffff; no-repeat; right-top; url("img_tree.png")
margin-right: 200px;}
</style>
</head>
<body>
<h1> CSS Background Shorthand Property</h1>
<p> The background property is the shorthand property for specifying all the properties in one line.</p>
</body>
</html>
Try this code for a better experience
0 Comments