इमेज पर टेक्स्ट को बॉटम-राइट (नीचे दाएं) कोने में रखने के लिए position: absolute के साथ bottom और right प्रॉपर्टीज़ का उपयोग करें।
उदाहरण: इमेज पर बॉटम-राइट टेक्स्ट
<!DOCTYPE html>
<html>
<head>
<style>
.box {
position: relative;
display: inline-block;
max-width: 100%;
}
img {
width: 100%;
height: auto;
opacity: 0.6;
display: block;
}
.direction {
position: absolute;
bottom: 10px;
right: 19px;
font-size: 13px;
color: white;
background: rgba(0,0,0,0.5);
padding: 5px 10px;
border-radius: 3px;
}
</style>
</head>
<body>
<h1>हेडिंग वन</h1>
<p>नीचे दी गई इमेज में टेक्स्ट बॉटम-राइट में है:</p>
<div class="box">
<img src="https://www.tutorialspoint.com/python/images/python_data_science.jpg" alt="Tutorial" width="800" height="400">
<div class="direction">बॉटम राइट कॉर्नर</div>
</div>
</body>
</html>
पोज़िशनिंग सारांश
| पोज़िशन | CSS |
|---|---|
| टॉप-लेफ्ट | top: 10px; left: 10px; |
| टॉप-राइट | top: 10px; right: 10px; |
| बॉटम-लेफ्ट | bottom: 10px; left: 10px; |
| बॉटम-राइट | bottom: 10px; right: 10px; |
| सेंटर | top: 50%; left: 50%; transform: translate(-50%, -50%); |
बेस्ट प्रैक्टिस
- पैरेंट पर
position: relativeआवश्यक - टेक्स्ट कंटेनर पर
position: absolute - पढ़ने योग्यता के लिए सेमी-ट्रांसपेरेंट बैकग्राउंड
z-indexसे लेयरिंग नियंत्रित करें