General Community > HTML/CSS

Background Image And CSS

(1/2) > >>

cleanfiles:
Hello I have added a background image but I cant get the css right.
This is what i have so far


--- Code: ---background-color: #000000;
background-image: url(images/BG.jpg);
        margin: 0 auto;
        padding: 12px 0 4px 0;
        width: 1000px;
--- End code ---

What i want to end up with is the image centered and repeating on the y axis
To give you an idea the forum is set at 1000px wide, the background image is 1200px wide, I want it centered behind the forum with 100px sticking out each side of the forum and then repeating along the y axis.
Any help is very appreciated.
Thanks.

Joey Smith™:
Try this:


--- Code: ---{
        background: url(images/BG.jpg) #000000 repeat-y;
        margin: 0 auto;
        padding: 12px 0 4px 0;
        width: 1000px;
}
--- End code ---

Please note: that you must upload your BG image in to the images folder of the theme you want it to show for.

Hope this helps:)

Joey Smith™:
By the way... If this happens to be 2.0 beta 4 it will be easier to do it this way (you didnt post the version)

Look in Themes/yourtheme/css/index.css


--- Code: ---#mainframe
{
font-size: 85%;
width: 95%;
background: url(../images/background.jpg) repeat-y;
background-attachment: fixed;
background-position: center;
padding-bottom: 0;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
margin: auto;
}
--- End code ---

cleanfiles:
Using 1.1.7
Your first post put me right , I ended up getting it using the following.


--- Code: ---background: url(images/BG.jpg) #000000 fixed center no-repeat;[code]
--- End code ---

Joey Smith™:
Glad it helped.

Could you please mark this topic as solved my changing the post icon in your original post..

Thanks :)

Navigation

[0] Message Index

[#] Next page

Go to full version