कैसे बनाएं: अर्ध-स्पष्ट लेख वाली छवि

CSS के द्वारा स्पष्ट (अर्ध-स्पष्ट) पृष्ठभूमि वाले लेख वाली छवि कैसे बनाएं।

स्पष्ट छवि लेख

नॉर्वे
शीर्षक

Lorem ipsum dolor sit amet, an his etiam torquatos. Tollit soleat phaedrum te duo, eum cu recteque expetendis neglegentur. Cu mentitum maiestatis persequeris pro, pri ponderum tractatos ei.

亲自试一试

स्पष्ट छवि लेख बनाना कैसे?

पहला कदम - HTML जोड़ें:

<div class="container">
  <img src="notebook.jpg" alt="Notebook" style="width:100%;">
  <div class="content">
    <h1>शीर्षक</h1>
    <p>Lorem ipsum..</p>
  </div>
</div>

दूसरा कदम - CSS जोड़ें:

.container {
  position: relative;
  max-width: 800px; /* अधिकतम चौड़ाई */
  margin: 0 auto; /* इसे केंद्रित करें */
}
.container .content {
  position: absolute; /* पृष्ठभूमि लेख स्थानीयकरण */
  bottom: 0; /* नीचे।top:0 का उपयोग करके इसे शीर्ष पर जोड़ें */
  background: rgb(0, 0, 0); /* पिछला रंग */
  background: rgba(0, 0, 0, 0.5); /* 0.5 अस्पष्टता वाला श्वेत पृष्ठभूमि */
  color: #f1f1f1; /* ग्रे लेख */
  width: 100%; /* पूर्ण चौड़ाई */
  padding: 20px; /* 一些内边距 */
}

亲自试一试