CSS kullanarak şeffaf (içini görebileceğiniz) bir arka plan metniyle nasıl bir görüntü oluşturacağınızı gösterelim..
Linkleri görebilmek için Turkmmo Forumuna ÜYE olmanız gerekmektedir.
Kod:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
body {
font-family: Arial;
font-size: 17px;
}
.container {
position: relative;
max-width: 800px;
margin: 0 auto;
}
.container img {vertical-align: middle;}
.container .content {
position: absolute;
bottom: 0;
background: rgb(0, 0, 0); /* Fallback color */
background: rgba(0, 0, 0, 0.5); /* Black background with 0.5 opacity */
color: #f1f1f1;
width: 100%;
padding: 20px;
}
</style>
</head>
<body>
<h2>Responsive Image with Transparent Text</h2>
<div class="container">
<img src="/w3images/notebook.jpg" alt="Notebook" style="width:100%;">
<div class="content">
<h1>Heading</h1>
<p>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.</p>
</div>
</div>
</body>
</html>
Şeffaf Resim Metni Nasıl Oluşturulur
Adım 1) HTML'yi ekleyin:
Kod:
<div class="container">
<img src="notebook.jpg" alt="Notebook" style="width:100%;">
<div class="content">
<h1>Heading</h1>
<p>Lorem ipsum..</p>
</div>
</div>
Adım 2) CSS'yi ekleyin:
Kod:
.container {
position: relative;
max-width: 800px; /* Maximum width */
margin: 0 auto; /* Center it */
}
.container .content {
position: absolute; /* Position the background text */
bottom: 0; /* At the bottom. Use top:0 to append it to the top */
background: rgb(0, 0, 0); /* Fallback color */
background: rgba(0, 0, 0, 0.5); /* Black background with 0.5 opacity */
color: #f1f1f1; /* Grey text */
width: 100%; /* Full width */
padding: 20px; /* Some padding */
}
Paylaşım için teşekkürler![]()
Paylaşım için teşekkürler.
Rica Ederim..Yorumlarınız için teşekkürler.Eline Sağlık Kirvem![]()
Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)
Benzer konular
- Cevaplar
- 2
- Görüntüleme
- 61
- Cevaplar
- 0
- Görüntüleme
- 142
- Cevaplar
- 0
- Görüntüleme
- 168
- Cevaplar
- 0
- Görüntüleme
- 117
