Background Image and blog content
-
Hi all,
I was wondering, is there a way, through CSS, to use a background image, but have a fixed white field the width of my content. Basically, I’d like to add some interest to my back ground but I’d like for it not to interfere with anything on the blog from the header all the way down. Any advice would be greatly appreciated! THanks!
The blog I need help with is: (visible only to logged in users)
-
Sorry; the formatting got messed up there at the end. Use this for your body:
body { background: repeat url(the-url-to-your-image); }
-
perfect, that worked great! Is there any way to make the white space a bit wider than the content itself, giving the text and images some “breathing room”? and what about the space between the .middle and the header where the background shows through? …or am I now just getting too picky haha THanks again for your help!
-
Okay, I kinda figured out how to make it wider…”Width: _____px; but it only goes out to one side, not evenly in both directions. Thoughts? The other questions from above still apply aswell. THanks!!
-
As an alternative, you might want to do the white background in .wrapper so that it runs the entire length of the site behind the header and clear down to the bottom of the footer.
.wrapper { background: #FFFFFF; width: 985px; }You will then probably want to add a bit of padding to the left of the content so it isn’t right up against the left side of the white area and also to the right of the sidebar.
#content { padding-left: 20px; } .sidebar { padding-right: 20px; } -
For the side-to-side width, use:
padding: 0 10px;
For the space in between the header and content area, change this:
#header-image {
margin: -25px 0 15px;
}to this:
#header-image {
margin: -25px 0 0;
height: 150px;
}Does that answer all of your questions?
-
Thanks thesacredpath, I think your suggestion is better, especially that of adding the padding to the content and sidebar areas separately. Otherwise, it breaks the layout.
-
@micahcooksey, mine breaks too, which is why I widened the wrapper by 40px (20px padding each side).
-
Thanks guys! but when I do this it bumps the sidebar to the bottom, any thoughts? also, is there a way to have the white space in the header shorten a bit to show the background along the top of the page?
-
Nevermind, it’s perfect!
One last minute nit-picky things before I call it a day, promise!:
– Is there a way to add white space to the side of my header image on the left as it shows on the right? I think it looks off-balance the way it is showing now.
Thanks again for all you help, this has been very helpful and I have also learned alot about CSS!
THanks!
-
Oh…and the “wrapper” code seems to cover something else up…
hgroup {
background:url(‘http://thebuddingdesigner.files.wordpress.com/2011/10/tagline.jpg’) no-repeat;
}it is an image with with a tagline text that I wanted to use instead of the automatic tagline. Anyway to bring this up above the white background of the “.wrapper” command? Thanks!
-
Sorry, I should have caught that. Add this to your CSS.
#header-image img { margin-left: 20px; margin-right: 20px; } -
Might want to put the 20px margin on the search box as well.
.search-form-holder { margin-right: 20px; } -
-
-
Ah, I figured it out. When you hid the standard title using display: none; (#header h1 a) it caused the image in hgroup to go with it.
Find #header h1 a in your CSS and remove the “display: none;” and put this in instead.
margin-left: -999px;That just moves the standard site title way off out of sight to the left.
-
That allowed it to display, but now you an see that header that I was hiding on the left…do I just make the margin bigger? Thanks!
-
I’m not seeing any image in Firefox, Safari or in Opera. Where is it showing? Can you take a screen shot of it, upload it to your media library and then post a link to it here?
-
@TSP
Using Firefox 7.0.1 I see > http://thebuddingdesigner.files.wordpress.com/2011/10/header-oct7.jpg
- The topic ‘Background Image and blog content’ is closed to new replies.