Centering a background image

D

David Berry

You can use CSS to set it to a fixed position or no-repeat. For example:

<STYLE TYPE="text/css">
<!--
BODY {
background-image: url(images/background.gif);
background-repeat:no-repeat;
background-position:center center;
background-attachment:fixed;
}
-->
</STYLE>

You'll have to play with the CSS to get it the way you want it
 
R

Rack Jite

Really having trouble with this!
I want the image centered to the max width of my content not
the whole page. You know, from the left edge of the left
sidebar to the right edge of the right sidebar.
I made the graphic so the edges shade into the next, so
making one big table for everything is not the answer, I
want that soft bleed going into the dead space.

Thanx!

RJ
 
M

Mike Mueller

Right idea, wrong tag though.

He would need to set up divs for his sidebars and content.
The content div would get the style you specified.

<style type="text/css"><!--
#right {}
#left {}
#main {
background-image: url(images/background.gif);
background-repeat:no-repeat;
background-position:center center;
background-attachment:fixed;
}
--></style>



: You can use CSS to set it to a fixed position or
no-repeat. For example:
:
: <STYLE TYPE="text/css">
: <!--
: BODY {
: background-image: url(images/background.gif);
: background-repeat:no-repeat;
: background-position:center center;
: background-attachment:fixed;
: }
: -->
: </STYLE>
:
: You'll have to play with the CSS to get it the way you
want it
:
:
:
: --
: David Berry
: FrontPage Support: http://www.frontpagemvps.com/
:
:
: : > Really having trouble with this!
: > I want the image centered to the max width of my content
not
: > the whole page. You know, from the left edge of the left
: > sidebar to the right edge of the right sidebar.
: > I made the graphic so the edges shade into the next, so
: > making one big table for everything is not the answer, I
: > want that soft bleed going into the dead space.
: >
: > Thanx!
: >
: > RJ
:
:
 
D

David Berry

Thanks Mike. I must have missed the "content" part. There was another
question on background images (same principle) and I had that on my mind I
guess.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top