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-28-2005, 11:26 PM   PM User | #1
MCD4x4
Regular Coder

 
Join Date: Feb 2003
Location: Brooklyn, New York
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
MCD4x4 is an unknown quantity at this point
background picture on web

Hi Folks,

I tried to use a picture for a background but if viewed on a higher screen size it tiles. Here's the link maybe you can tell what I'm doing wrong. www.mcd4x4.com/alana.htm
__________________
BrianNY/Rookie
MCD4x4 is offline   Reply With Quote
Old 05-28-2005, 11:56 PM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
A background image will tile to fit the resolution unless you tell it not to. Would you want it centered and not to repeat?
Code:
<style type="text/css">
<!--
body {
background-image:url(alanaspage/3-19-05/page1.jpg);
background-position:center;
background-repeat:no-repeat;
background-color:#FFFFFF;
}
-->
</style>
you can add that in your head tags to make it not repeat, it will center on any resolution.
_Aerospace_Eng_ is offline   Reply With Quote
Old 05-28-2005, 11:58 PM   PM User | #3
mark87
Senior Coder

 
Join Date: Dec 2004
Location: Essex, UK
Posts: 2,636
Thanks: 0
Thanked 0 Times in 0 Posts
mark87 is on a distinguished road
If you want a non-repeating background - so it doesn't tile - then do something like so -

body {
background: url(picture.jpg) no-repeat;
}

Although, then in larger resolutions, the background will stop half way. I don't think you can stretch the background to cater for all resolutions.

EDIT: Darn, was beaten to it.
mark87 is offline   Reply With Quote
Old 05-29-2005, 12:01 AM   PM User | #4
MCD4x4
Regular Coder

 
Join Date: Feb 2003
Location: Brooklyn, New York
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
MCD4x4 is an unknown quantity at this point
So than the css sounds like the way to go?
__________________
BrianNY/Rookie
MCD4x4 is offline   Reply With Quote
Old 05-29-2005, 12:19 AM   PM User | #5
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
css is the standards way to go, you could use the old html attributes like bgpropties="fixed" or bgcolor="blah" but thats deprecated and shouldn't be used. CSS should be used in place of it.
_Aerospace_Eng_ is offline   Reply With Quote
Reply

Bookmarks

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 05:11 PM.


Advertisement
Log in to turn off these ads.