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 5 of 5
  1. #1
    New Coder
    Join Date
    Nov 2011
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts

    How to make a transparent image span the ENTIRE webpage.

    Hey everyone,


    I have a special request that I hope someone here may be able to help me with. I want to have a transparent png. span across the entire webpage, no matter what monitor size visitors are using. There are no clickable links or interactive features, and I do not want to use the transparent image as a background. I have already laid a transparent image over my webpage and for the most part, it's suitable.

    However when I right click the very bottom of the webpage(where the page is actually clickable and the transparent png does not reach) I am able to view the background image and source code etc of the page. I would simply like a solution to span the transparent image over the whole page and not have any spots where I can right click and view source/bgrnd image etc. If you can give me a snippet of html to help me solve this problem, I would be more than appreciative. Thank you all so much.

  • #2
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    881
    Thanks
    0
    Thanked 115 Times in 114 Posts
    It is not worth the time to try to prevent users from getting information through right click, as browsers offers these features from their main menu.

  • #3
    Regular Coder Taro's Avatar
    Join Date
    Oct 2011
    Location
    Geraldton, Ontario
    Posts
    155
    Thanks
    1
    Thanked 1 Time in 1 Post
    Hello,

    Depending on your target audience, you may not want to restrict users from doing a right-click, as there are ways of getting around the problem, like disabling JavaScript from their browsers. Also, this could be an accessibility issue (maybe depending on what content or if for other reasons than taking or copying one's work), so be careful.

    Moreover, I would simply change the transparency through an image editor rather than using a code snippet to do it.
    Element ID

    Webs Support Helper

    Your friendly neighborhood Taroman.

  • #4
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    881
    Thanks
    0
    Thanked 115 Times in 114 Posts
    Quote Originally Posted by Taro View Post
    ... there are ways of getting around the problem, like disabling JavaScript from their browsers.
    This has nothing to do with javascript.
    This is a question of having a transparent overlay image that covers the entire page, thus preventing users from clicking outside it, in order to get the "view source" option in the browsers default contextmenu.

    To no avail! Users can simply go to the browsers main menu to get this options.

    As you can't prevent users from getting the source of the document, by a simple action, it is not worth the time to try.

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello nightshade877,
    This has been gone over so many times that there is a link for it in the FAQ sticky - http://www.codingforums.com/showthre...173#post182173

    Instead of an image, maybe this would work for you? Still doesn't do what you're trying to do though... -
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    	height: 100%;
    	margin: 0;
    	background: #fc6;
    }
    #mask {
    	height: 100%;
    	width: 100%;
    	position: absolute;
    	top: 0;
    	left: 0;
    }
    #container {
    	height: 600px;
    	width: 800px;
    	margin: 0 auto;
    	background: #999;
    }</style>
    </head>
    <body>
    	<div id="mask"></div>
        <div id="container">
        	Your super secret website goes here
        <!--end container--></div>
    </body>
    </html>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Tags for this Thread

    Posting Permissions

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