Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> JavaScript

CSS में background-attachment गुण का उपयोग

background-attachment गुण का उपयोग पृष्ठभूमि में छवि के स्क्रॉलिंग को नियंत्रित करने के लिए किया जाता है।

उदाहरण

निम्न कोड चलाकर background-attachment गुण के साथ काम करना सीखें:

<!DOCTYPE html> <html>
  <head>
    <style>
      body {
        background-image: url('/css/images/css.jpg');
        background-repeat: no-repeat;
        background-attachment: fixed;
      }
    </style>
  </head>
  <body>
    <p>The background-image is fixed. Try to scroll down the page.</p>
    <p>The background-image is fixed. Try to scroll down the page.</p>
    <p>The background-image is fixed. Try to scroll down the page.</p>
    <p>The background-image is fixed. Try to scroll down the page.</p>
    <p>The background-image is fixed. Try to scroll down the page.</p>
    <p>The background-image is fixed. Try to scroll down the page.</p>
    <p>The background-image is fixed. Try to scroll down the page.</p>
  </body>
</html>

fixed मान छवि को व्यूपोर्ट के सापेक्ष स्थिर रखता है।

  1. - CSS में border-right-width गुण का उपयोग

    border-right-width गुण दाएं बॉर्डर की चौड़ाई बदलता है। निम्न कोड चलाकर border-right-width गुण लागू करें: उदाहरण <html> <head> </head> <body> <p style=border-right-width:6px;border-style:solid;> This is demo content. </p> </body> </ht

  1. - CSS में border-right-style गुण का उपयोग

    border-right-style गुण दाएं बॉर्डर की शैली बदलता है। निम्न कोड चलाकर border-right-style गुण लागू करें: उदाहरण <html> <head> </head> <body> <p style=border-width:4px;border-right-style:dashed;> This is demo content </p> </body> </html

  1. - CSS में border-left-width गुण का उपयोग

    border-left-width गुण बाएं बॉर्डर की चौड़ाई बदलता है। निम्न कोड चलाकर border-left-width गुण लागू करें: उदाहरण <html> <head> </head> <body> <p style=border-left-width:6px;border-style:solid;> This is demo content. </p> </body> </html&