Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-05-2012, 05:45 AM   PM User | #1
nightshade877
New Coder

 
Join Date: Nov 2011
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
nightshade877 is an unknown quantity at this point
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.
nightshade877 is offline   Reply With Quote
Old 05-05-2012, 06:25 AM   PM User | #2
Lerura
Regular Coder

 
Lerura's Avatar
 
Join Date: Aug 2005
Location: Denmark
Posts: 869
Thanks: 0
Thanked 112 Times in 111 Posts
Lerura will become famous soon enough
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.
Lerura is offline   Reply With Quote
Old 05-05-2012, 07:04 PM   PM User | #3
Taro
Regular Coder

 
Taro's Avatar
 
Join Date: Oct 2011
Location: Geraldton, Ontario
Posts: 155
Thanks: 1
Thanked 1 Time in 1 Post
Taro is an unknown quantity at this point
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.
Taro is offline   Reply With Quote
Old 05-05-2012, 08:59 PM   PM User | #4
Lerura
Regular Coder

 
Lerura's Avatar
 
Join Date: Aug 2005
Location: Denmark
Posts: 869
Thanks: 0
Thanked 112 Times in 111 Posts
Lerura will become famous soon enough
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.
Lerura is offline   Reply With Quote
Old 05-05-2012, 11:02 PM   PM User | #5
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
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
Excavator is offline   Reply With Quote
Reply

Bookmarks

Tags
entire, image, transparent, webpage

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:45 AM.


Advertisement
Log in to turn off these ads.