Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Safari acts weird with opacity?

    hey anyone with a mac please check out this code in Safari...

    Code:
    <html>
    <head>
    
    <style type="text/css">
    #page_screen
    {
       background-color:#000000;
       filter:alpha(opacity=60);  
       opacity: 0.6;     
       position:absolute;
       top:0px;
       left:0px;
       width:100%;
       height:500px
       display:block;
    }
    </style>
    
    
    </head>
    <body id="page_screen">
    Some Text Here
    </body>
    </html>
    it is supposed to make a big block on the screen that is kinda see-thru but it just comes out black. if you put the page_screen id in a div tag it works better but I want it in the body tag. why is it acting so weird?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,662
    Thanks
    6
    Thanked 1,006 Times in 979 Posts
    You should use a div instead of the body tag itself as this isn't really easy to style (yet). Especially, it's varying from browser to browser, and Safari is one of those that doesn't handle it too good.

    Also putting black text and a black background color will result in one big black square even if you set opacity (then it will just be a opaque black square and still no visible text).

    Plus: display: block; for a div or the body tag are useless as divs are block-level elements by default and the body is a special case anyway.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •