Make a div semi-transparent

Posted 18 April, 2009 in Other Stuff

This does not work in all browsers but seems fine in the latest ie and firefox. Just add the following to the style of the div:

filter: alpha(opacity=50); 
-moz-opacity: .50;

It takes two lines of code. One for ei and the other for firefox. The numbers is how see-through you want it. The higher the number the more solid the colour.

Remember that the div also needs a backgroud colour.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • StumbleUpon
  • Twitter
  • Yahoo! Buzz

Your comment: