Solved

Background images

Posted on 2003-11-10
8
7,505 Views
Last Modified: 2010-04-25
I currently have my site load a background image using this code:

<style type="text/css">
<!--
body
{
  background-position: top;
  background-repeat: no-repeat;
  background-image: url("../Images/Background.jpg");  /*default image background*/
}

-->
</style>

Is it possible to make this image stretch to the full size of users screen rather that it just being the normal pixel size?  
0
Comment
Question by:sre22
8 Comments
 
LVL 1

Accepted Solution

by:
NeoTek earned 25 total points
ID: 9718057
Hi,

Unfortunately there is no way to do this with CSS.  Depending on your picture depends on how you can make it look "good".  You can set the background to repeat, use layers or make the image very big.  Could you please provide a link to your site  so I may explain the best possible method?

NeoTek
0
 

Author Comment

by:sre22
ID: 9718259
Unfortunately it is an Intranet so you won't have access to it.  The backgrounds fit a 1024x768 resolution but when using a larger resolution the image does not fill the screen.  I tried using a repeating background but it doesn't look right because the image just looks tiled.
0
 

Author Comment

by:sre22
ID: 9718287
how do the other options work that you were talking about (frames etc..)
0
 
LVL 8

Assisted Solution

by:klykken
klykken earned 25 total points
ID: 9720115
Background images never stretch :-/ That goes for any element unfortunately.

-klykken
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:sre22
ID: 9723367
Thanks..
0
 
LVL 2

Expert Comment

by:danalmar
ID: 10019565
oups,
sorry to desagree, but you can use a JavaScript to strech it.
thanks to Massimo Foti !


<script language="JavaScript">
function makeIm() {
NS4=(document.layers);
IE4=(document.all);
scaleWidth = true;
scaleHeight = true;
imSRC = "images/yourImage.jpg";
if (NS4) {
origWidth = innerWidth;
origHeight = innerHeight;}
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();}
if (NS4) onresize = reDo;
if (IE4) onresize = reDoIE;
function reDoIE(){
imBG.width = document.body.clientWidth;
imBG.height = document.body.clientHeight;}
winWid = (NS4) ? innerWidth : document.body.clientWidth;
winHgt = (NS4) ? innerHeight : document.body.clientHeight;
imStr = "<div id=elBGim"
+ " style='position:absolute;left:0;top:0;z-index:-1'>"
+ "<img name='imBG' border='0' src="+imSRC;
if (scaleWidth) imStr += " width="+winWid;
if (scaleHeight) imStr += " height="+winHgt;
imStr += "></div>";
document.write(imStr);}
makeIm();
</script>
0
 

Expert Comment

by:pmanse
ID: 10736476
It's doing exactly what I want/expect it to, but I'm getting an "object required" runtime error on the line: "winWid = (NS4) ? innerWidth : document.body.clientWidth;" I asked a developer who's better with JavaScript than i am if he'd take a look. He's questioning the imBG object and thinks I'm missing an include. Do you know what might be going on?
0
 

Expert Comment

by:pmalatac
ID: 11555442
This script doesnt seem to run in navigator 7.1.  It works fin in IE6 though any suggestions??
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Record Button 3 217
SWF won't scale? 4 521
Does Adobe/Dreamweaver Have Free Website Templates? 2 409
Live mode in DW, need to creae Session 4 79
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now