HighDots Forums  

Centering Background Image

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Centering Background Image in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PeacefulHarry
 
Posts: n/a

Default Centering Background Image - 08-03-2007 , 11:11 PM






I set a background image using 'Page Properties', but I don't want the image
to repeat. When I put it up, the image is in the top left-hand corner. Isn't
there a way the the image can be centered? It would be most helpful. Thanks!


Reply With Quote
  #2  
Old   
JoeyD1978
 
Posts: n/a

Default Re: Centering Background Image - 08-03-2007 , 11:26 PM






Go to your code view and look for the body style in the head of your document.
Adjust it so it looks something like this:

<!--
body {
background-image: YOURFILE;
background-repeat:no-repeat;
background-position: top center;
}
-->


Reply With Quote
  #3  
Old   
Walt F. Schaefer
 
Posts: n/a

Default Re: Centering Background Image - 08-04-2007 , 12:22 AM



Correct syntax:

background-image: url(YOURFILE);

If OP wants image centered vertically as well as horizontally:

background-position: center center;


--

Walt


"JoeyD1978" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Go to your code view and look for the body style in the head of your
document.
Adjust it so it looks something like this:

!--
body {
background-image: YOURFILE;
background-repeat:no-repeat;
background-position: top center;
}
--




Reply With Quote
  #4  
Old   
Gary White
 
Posts: n/a

Default Re: Centering Background Image - 08-04-2007 , 10:32 AM



On Fri, 3 Aug 2007 21:22:55 -0700, "Walt F. Schaefer"
<walt (AT) waltswebworx (DOT) com> wrote:

Quote:
background-position: center center;
or:

background-position: center;

Gary


Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.