OnurBoyla 1
OnurBoyla
noisiv 1
noisiv
Manwe Work 1
Manwe Work
farkmt2official 1
farkmt2official
mavzermete 1
mavzermete
dreamstone 1
dreamstone
Hikaye Ekle

CSS İle Şeffaf Görüntü Elde Etmek..

  • Konuyu başlatan Konuyu başlatan ByESiNTi
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 4
  • Görüntüleme Görüntüleme 275

HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. HEMEN TIKLA!

CSS Opaklığı / Şeffaflığı

opacityNitelik bir elemanın donukluk / şeffaflığı belirtir.

Şeffaf Görüntü

opacityÖzelliği 0,0 arasında bir değer alabilir - 1.0 arasındadır. Değer ne kadar düşükse, o kadar şeffaftır:




Kod:
<!DOCTYPE html>
<html>
<head>
<style>
img {
  opacity: 0.5;
}
</style>
</head>
<body>

<h1>Image Transparency</h1>
<p>The opacity property specifies the transparency of an element. The lower the value, the more transparent:</p>

<p>Image with 50% opacity:</p>
<img src="img_forest.jpg" alt="Forest" width="170" height="100">

</body>
</html>

Şeffaf Hover Etkisi

opacityTesis, genellikle birlikte kullanılır :hoverfare üzerinde üzerinde donukluk değiştirmek için selektör:



Kod:
<!DOCTYPE html>
<html>
<head>
<style>
img {
  opacity: 0.5;
}

img:hover {
  opacity: 1.0;
}
</style>
</head>
<body>

<h1>Image Transparency</h1>
<p>The opacity property is often used together with the :hover selector to change the opacity on mouse-over:</p>
<img src="img_forest.jpg" alt="Forest" width="170" height="100">
<img src="img_mountains.jpg" alt="Mountains" width="170" height="100">
<img src="img_5terre.jpg" alt="Italy" width="170" height="100">

</body>
</html>

Örnek açıklama

İlk CSS bloğu Örnek 1'deki koda benzer. Ayrıca, bir kullanıcı fareyle resimlerden birinin üzerine geldiğinde ne olması gerektiğini ekledik. Bu durumda, kullanıcı üzerine geldiğinde görüntünün saydam OLMAMASINI istiyoruz. Bunun için CSS opacity:1;.

Fare işaretçisi görüntüden uzaklaştığında görüntü tekrar saydam olacaktır.

Ters vurgulu efektine bir örnek:




Kod:
<!DOCTYPE html>
<html>
<head>
<style>
img:hover {
  opacity: 0.5;
}
</style>
</head>
<body>

<h1>Image Transparency</h1>
<p>The opacity property is often used together with the :hover selector to change the opacity on mouse-over:</p>
<img src="img_forest.jpg" alt="Forest" width="170" height="100">
<img src="img_mountains.jpg" alt="Mountains" width="170" height="100">
<img src="img_5terre.jpg" alt="Italy" width="170" height="100">

</body>
</html>

Şeffaf Kutu





Kod:
<!DOCTYPE html>
<html>
<head>
<style>
div {
  background-color: #4CAF50;
  padding: 10px;
}

div.first {
  opacity: 0.1;
}

div.second {
  opacity: 0.3;
}

div.third {
  opacity: 0.6;
}
</style>
</head>
<body>

<h1>Transparent Box</h1>
<p>When using the opacity property to add transparency to the background of an element, all of its child elements become transparent as well. This can make the text inside a fully transparent element hard to read:</p>

<div class="first"><p>opacity 0.1</p></div>
<div class="second"><p>opacity 0.3</p></div>
<div class="third"><p>opacity 0.6</p></div>
<div><p>opacity 1 (default)</p></div>

</body>
</html>

Şeffaf Kutudaki Metin​




Kod:
<!DOCTYPE html>
<html>
<head>
<style>
div.background {
  background: url(klematis.jpg) repeat;
  border: 2px solid black;
}

div.transbox {
  margin: 30px;
  background-color: #ffffff;
  border: 1px solid black;
  opacity: 0.6;
}

div.transbox p {
  margin: 5%;
  font-weight: bold;
  color: #000000;
}
</style>
</head>
<body>

<div class="background">
  <div class="transbox">
    <p>This is some text that is placed in the transparent box.</p>
  </div>
</div>

</body>
</html>
 
Son düzenleme:

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst