background शॉर्टहैंड प्रॉपर्टी
किसी एलिमेंट के बैकग्राउंड प्रॉपर्टीज़ को background एट्रिब्यूट से निर्दिष्ट करें। यह निम्न मान ले सकता है: background-color, background-image, background-repeat, background-position, background-clip, background-size, background-origin, background-attachment।
सिंटैक्स
Selector { background: /*value*/ }
उदाहरण 1
<!DOCTYPE html>
<html>
<head>
<style>
body {
background: gray url("https://www.tutorialspoint.com/pytorch/images/pytorch.jpg") no-repeat;
font-size: 1.2em; color: black;
}
h2 { -webkit-text-fill-color: transparent; -webkit-text-stroke: 1px black; }
p { box-shadow: 0 0 5px 5px black; }
</style>
</head>
<body>
<h2><i>PYTORCH Tutorial</i></h2>
<p>This is demo text...</p>
<ul><li>One</li><li>Two</li><li>Three</li><li>Four</li><li>Five</li></ul>
</body>
</html>
आउटपुट

उदाहरण 2
<!DOCTYPE html>
<html>
<head>
<style>
h2 { background-color: bisque; }
div { margin: auto; background-color:orange; width: 40%; }
</style>
</head>
<body>
<h2>Demo Text</h2>
<div>demo demo demo demo</div>
</body>
</html>
आउटपुट
