Reply
I need help
Old 11-26-2004, 01:24 PM I need help:Background Images
Novice Talker

Posts: 8
I'm designing a web page in dreamweaver MX and I cant get my background image to stretch across the whole page. Instead it just tiles it, if you know a way to get it to stretch the background image to fit the page please let me know

Last edited by me.com : 11-28-2004 at 03:18 PM.
me.com is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 11-26-2004, 01:33 PM
southernlady's Avatar
Extreme Talker

Posts: 175
Name: Liz
Location: NC
What size is your graphic and can it be resized outside of dreamweaver?
__________________

GBLCreations
southernlady is offline
Reply With Quote
View Public Profile Visit southernlady's homepage!
 
Old 11-26-2004, 01:57 PM
Novice Talker

Posts: 8
I can resize in fireworks, but how can I get it to be 100% accross tne background for all screen sizes?
Thanks
me.com is offline
Reply With Quote
View Public Profile
 
Old 11-26-2004, 02:03 PM
southernlady's Avatar
Extreme Talker

Posts: 175
Name: Liz
Location: NC
That you do by using a percent and not using a number.

You want it to be 100% of the width. And this is where HAND coding makes it easier cause you can tell it exactly what to do.

Unfortunately, I must step away for a little while. I'll be back in about 2-3 hours. If someone hasn't come in and helped you by then, I'll come back and guide you to the right tutorials, ok? Liz
__________________

GBLCreations
southernlady is offline
Reply With Quote
View Public Profile Visit southernlady's homepage!
 
Old 11-26-2004, 02:17 PM
monkey's Avatar
Ultra Talker

Posts: 439
im guessing something like this would work

Code:
body {
background-image: url(background.jpg);
background-repeat: no-repeat;
background-position: 100%; }
monkey is offline
Reply With Quote
View Public Profile Visit monkey's homepage!
 
Old 11-26-2004, 04:09 PM
southernlady's Avatar
Extreme Talker

Posts: 175
Name: Liz
Location: NC
Thanks, monkey...unfortunately, he won't see it til tomorrow now cause he emailed me and will be away from his computer. I did just email him back and let him know that there is an answer waiting on him here. Liz
__________________

GBLCreations
southernlady is offline
Reply With Quote
View Public Profile Visit southernlady's homepage!
 
Old 11-28-2004, 12:34 PM
Rincewind's Avatar
Super Talker

Posts: 108
Quote:
background-position: 100%;
This style setting won't make the image 100% of the screen size. It will just shift the image 100% of the page width to the right. However you will probably want to use some css to stop the image tiling vertically or moving off the top when the page is scrolled. This is done using code like this:
Code:
body {
	background-image: url(Front.jpg);
	background-repeat: no-repeat;
	background-attachment: fixed;
}
To get the size to adjust, the only method is to use a script (php or javascript) to sniff for the users screen size and then load in the appropriate size of image. However even this has problems cause the screen size rarely equals browser size. You have know way to know whither there are panels or toolbars on the browser window or even whither the browser window is maximised to the screen or not.

One sollution to your problem may be to fake the effect. Use two or three images for the background. One static one say in the top left corner. Then a second statis in the top right corner. Finally a third image tiles between to two to give the apperance of one continuous image that streaches but isn't really.
__________________
Q-4.net - Reseller web hosting programs
Stylegallery.co.uk - Scottish Landscape Photography Gallery
Splodgy.com - Web design tutorials
Rincewind is offline
Reply With Quote
View Public Profile
 
Old 11-28-2004, 12:55 PM
Novice Talker

Posts: 8
i inserted the code, but nothings happening to the page
me.com is offline
Reply With Quote
View Public Profile
 
Old 11-28-2004, 01:11 PM
Rincewind's Avatar
Super Talker

Posts: 108
The css code should go in the head section of your page inside style tags (or else into an external style sheet, but lets not confuse things.) for exampe
Code:
<html>
<head>
<style type="text/css">
body {
	background-image: url(Front.jpg);
	background-repeat: no-repeat;
	background-attachment: fixed;
}
</style>
You should also chang "front.jpg" to the actuall path and name of the image file you are using.
__________________
Q-4.net - Reseller web hosting programs
Stylegallery.co.uk - Scottish Landscape Photography Gallery
Splodgy.com - Web design tutorials
Rincewind is offline
Reply With Quote
View Public Profile
 
Old 11-28-2004, 03:16 PM
Novice Talker

Posts: 8
thanks for your help
me.com is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to I need help
 

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14354 seconds with 12 queries