Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-05-2011, 02:43 AM   PM User | #1
sixrfan
Regular Coder

 
Join Date: Aug 2009
Posts: 395
Thanks: 116
Thanked 0 Times in 0 Posts
sixrfan has a little shameless behaviour in the past
Need background to stretch across the page

Any idea what css element I can apply a background to, and how to apply it, in order to get this image to repeat-x across the top of the page on this site?

The problem is that I already have a background image applied to the body so that I can get that green felt to repeat across the rest of the page.

Please advise. Thanks in advance.
sixrfan is offline   Reply With Quote
Old 09-05-2011, 04:28 AM   PM User | #2
chaule
New Coder

 
Join Date: Aug 2011
Posts: 23
Thanks: 0
Thanked 2 Times in 2 Posts
chaule is an unknown quantity at this point
Hi,

Not sure if this is the best way but maybe put it as a div at the top of the page. If you want your menu to sit infront of the lower part of the image put it within the div a couple of lines down.

Maybe something like:
Code:
.headerImage
{
   background:url('http://www.willowbilliards.com/wp-content/uploads/site-elements/banner-bg.jpg') repeat-x;
   margin-top:-15px;
}
.headerSpacer
{
   height:100px;
}
Code:
<div class="headerImage">
   <div class="headerSpacer"></div>
   ...(markup for menu here)..
   <br />....
</div>
chaule is offline   Reply With Quote
Users who have thanked chaule for this post:
sixrfan (09-05-2011)
Old 09-05-2011, 04:52 AM   PM User | #3
mlg5454
New Coder

 
Join Date: Oct 2007
Posts: 49
Thanks: 2
Thanked 1 Time in 1 Post
mlg5454 is an unknown quantity at this point
do you want the new brick image to replace the old brick image behind the text of the page? in that case you need a new graphic.

in any case, like the person above me has said, you need a new div, and to say background: url(-that image-) repeat-x; , and the div should be the height and width of that original image... something like that...
mlg5454 is offline   Reply With Quote
Users who have thanked mlg5454 for this post:
sixrfan (09-05-2011)
Old 09-05-2011, 01:59 PM   PM User | #4
sixrfan
Regular Coder

 
Join Date: Aug 2009
Posts: 395
Thanks: 116
Thanked 0 Times in 0 Posts
sixrfan has a little shameless behaviour in the past
got it. thanks!
sixrfan is offline   Reply With Quote
Old 09-08-2011, 01:59 PM   PM User | #5
sixrfan
Regular Coder

 
Join Date: Aug 2009
Posts: 395
Thanks: 116
Thanked 0 Times in 0 Posts
sixrfan has a little shameless behaviour in the past
i have a followup question...

you know how its possible to setup a body background so that an image repeats, then when it stops repeating, a color fills the rest like this...
Code:
body {background: url(images/bg.jpg) repeat-x left top #FFFFF;}
well is it possible to have a different image fill the rest of the space after the first stops repeating? maybe something like this?
Code:
body {background: url(images/bg1.jpg) repeat-x left top url(images/bg2.jpg;}
please advise. thanks in advance.
sixrfan is offline   Reply With Quote
Old 09-08-2011, 08:10 PM   PM User | #6
vikram1vicky
Regular Coder

 
Join Date: Jul 2011
Location: India
Posts: 496
Thanks: 3
Thanked 57 Times in 56 Posts
vikram1vicky is an unknown quantity at this point
If you wil correct and valid cSS properties, It won't happen that, image will not repeat for full page...

You should give background color matching your background image, in case image won't loaded properly, you design wont messed up .

For example, if your background image is of dark color and font is white/light color... in case background image is missing, you light font wont be visible...

So, its better to define matching color with background image...

Following is the valid sample code:

Code:
body {
background:#f00 url(images/imgname.png) repeat;
}
vikram1vicky is offline   Reply With Quote
Reply

Bookmarks

Tags
background, css

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:01 AM.


Advertisement
Log in to turn off these ads.