Jump to content

Opacitatea Si Transparenta In Css


skyler_sdf

Recommended Posts


//modificarea transparentei la mouseover

//cand mutam cursorul mouse-ului in afara imaginii, aceasta trebuie sa redevina transparenta. Acest lucru este realizat de atributul onmouseout.

<img src="imagine1.jpg" style="opacity:0.4;filter:alpha(opacity=40)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" />

//In IE ( filter:alpha(opacity=x) ), x poate lua valori de la 0 la 100. La fel ca in Firefox, cu cat valoarea este mai mica, cu atat elementul este mai transparent.


//in cel de al doilea caz imaginea este transparenta pana la prima mutare a cursorului mouse-ului

<img src="imagine2.jpg" style="opacity:0.4;filter:alpha(opacity=40)" 

onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" />

  • Upvote 1
Link to comment
Share on other sites

Dar daca folosim codul in genul asta:

<style type="text/css">

img.c1 {opacity:0.4;filter:alpha(opacity=40)}

</style>

<img src="imagine1.jpg" class="c1" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" alt="** please DESCRIBE THIS IMAGE **">

Nu este la fel? Si astfel avem si un cod valid, pentru cei care doresc asta

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.