Old 14-07-2004, 12:12   #1 (permalink)
Damion
I ain't afraid of no post
 
Damion's Avatar
 
Join Date: Mar 2004
Location: Bradford, Uk
Posts: 416
Dreamweaver problem2

I am having difficulties with my background image, its just to the left and I can't seem to arrange to the centre, can any1 help? Would I have to go back to my image and edit it with space on the left and right sides placing the image into the centre, I have created it in photoshop. Cheers
  Reply With Quote
Old 14-07-2004, 12:16   #2 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 5,527
Quote:
Originally Posted by Damion
Would I have to go back to my image and edit it with space on the left and right sides placing the image into the centre
How would you know what resolution people have?

http://www.w3schools.com/css/css_reference.asp
Have a look at background-position.
  Reply With Quote
Old 14-07-2004, 12:37   #3 (permalink)
JiRaffe
Ur mother's ur brother?
 
JiRaffe's Avatar
 
Join Date: Jun 2003
Location: Liverpool
Posts: 880
or you could put the background image in a table and centre the table. would mess with the whole rest of any design you had though as content would have to sit within than table. follow stick's guide, he knows best
__________________
::: TC Magazine :::
  Reply With Quote
Old 14-07-2004, 13:20   #4 (permalink)
adras
Zły
 
adras's Avatar
 
Join Date: May 2004
Location: Toronto, Canada
Posts: 2,001
Send a message via MSN to adras
You might want to give this a try....

body {
margin: auto 0px;
}
__________________
  Reply With Quote
Old 15-07-2004, 04:01   #5 (permalink)
Damion
I ain't afraid of no post
 
Damion's Avatar
 
Join Date: Mar 2004
Location: Bradford, Uk
Posts: 416
cheers stickman just trying to learn HTML I think I'm getting there. Just trying to understand where exactly certain abbreviations go?
  Reply With Quote
Old 15-07-2004, 04:15   #6 (permalink)
Damion
I ain't afraid of no post
 
Damion's Avatar
 
Join Date: Mar 2004
Location: Bradford, Uk
Posts: 416
Just experimenting at the minute. Any reason why the background doesn't center I've tried those from w3school didn't work!
  Reply With Quote
Old 15-07-2004, 04:50   #7 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 5,527
Link?
  Reply With Quote
Old 15-07-2004, 05:37   #8 (permalink)
Damion
I ain't afraid of no post
 
Damion's Avatar
 
Join Date: Mar 2004
Location: Bradford, Uk
Posts: 416
sorry haven't got a link just yet!
  Reply With Quote
Old 15-07-2004, 05:57   #9 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
Code?
  Reply With Quote
Old 15-07-2004, 06:37   #10 (permalink)
Damion
I ain't afraid of no post
 
Damion's Avatar
 
Join Date: Mar 2004
Location: Bradford, Uk
Posts: 416
body {
background-image: url(photoshop/background.jpg);
background-repeat: no-repeat;
background-position: center
margin-left: 0px;
margin-right: 0px;
}
  Reply With Quote
Old 15-07-2004, 06:38   #11 (permalink)
Damion
I ain't afraid of no post
 
Damion's Avatar
 
Join Date: Mar 2004
Location: Bradford, Uk
Posts: 416
what do you think?
  Reply With Quote
Old 15-07-2004, 08:05   #12 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
body {
background-image: url(photoshop/background.jpg);
background-repeat: no-repeat;
background-position: center;
margin-left: 0px;
margin-right: 0px;
}

missing a semi-colon there.

you could also do it all in one background definition like this:

background:url(blah) no-repeat center;
  Reply With Quote
Old 15-07-2004, 08:07   #13 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
As an aside why didn't w3c make it repeat-no. That would make it much easier to change e.g. repeat-x to repeat-no.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8