Background image left and right of centered div

This is a discussion on "Background image left and right of centered div" within the Web Page Design section. This forum, and the thread "Background image left and right of centered div are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 13th, 2006, 12:21
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Background image left and right of centered div

I have all of my content in a wrapper div which postions center of the screen so it will always be in the center no matter what screen resolution a user has.

I have noticed that becuase I have a high screen resolution that there is a lot of empty space to the left and right of all the content.

I have tried changing the body colour with my stylesheet but the wrapper div is affected by the body colour.

I only noticed this becuase I am thinking about having a repeated image to the left and right space to give it a pillar effect. I want to break up the page so it doesn't look so white.

Is there something wrong with my css that is taking on the body color
Code: Select all
 
#wrapper {
   margin: 0 auto;
   width: 775px;
   text-align: left;
   position: relative;
   background-color: #FFFFFF;
}
And how would I add a repeating image on the left and right sides?
Reply With Quote

  #2 (permalink)  
Old Aug 13th, 2006, 12:52
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Background image left and right of centered div

make an image that is 770px wide and use background-repeat:repeat-y;

It would be easier to help if you posted an URL...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
  #3 (permalink)  
Old Aug 13th, 2006, 13:04
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: Background image left and right of centered div

actually.... I would make an image around 2000px wide, with a 775px hole in the middle.

On either side of this hole, just add your design you want to repeat.

Then set this as a centered background on the body element. The hole should align perfectly to your content, leaving a left and right repeated background.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #4 (permalink)  
Old Aug 13th, 2006, 15:04
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Background image left and right of centered div

here is the url

http://www.project-sw.co.uk/jack/

and even for my old one

http://www.project-sw.co.uk

Thanks peeps
Reply With Quote
  #5 (permalink)  
Old Aug 13th, 2006, 17:51
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Background image left and right of centered div

If you view your new site in Firefox, you will see that the navgation block titles are out of alignment.
Reply With Quote
  #6 (permalink)  
Old Aug 13th, 2006, 20:58
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Background image left and right of centered div

Yeah I know

It's something i got to sort out

I noticed firefox interprets some css differently than IE like the em
Reply With Quote
  #7 (permalink)  
Old Aug 13th, 2006, 22:15
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Background image left and right of centered div

Because Firefox, Opera and others are far more standards compliant than IE, you should get in the habit of getting your sites working perfectly in Firefox first and then tweak as required for IE.
Reply With Quote
  #8 (permalink)  
Old Aug 14th, 2006, 20:40
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Background image left and right of centered div

I have started to make the site cross browser compliant but have come across a problem.

I have made a div inside a div which now makes the blue bar appear aligned with the little image aligned correctly.

I need some text such as Navigation, Membership etc but if i use <h3> or <p> to add the text I noticed that the text is not inline with the image but pushed down slightly

How can I align the text next to the image?
Code: Select all
 
.news {
   width: 190px;
   margin-left: 5px;
   margin-right: 5px;
   margin-top:5px;
   background-color: #E4EFFF; /*#EDF0F6*/
   border: 1px solid #FFFFFF;
}
.heading {
   width: 190px;
   height: 25px;
   background-color: #5797F1;
}
h3.head {
   color: #FFFFFF;
}
Code: Select all
 
This is just the test code
<div class="news"><div class="heading"><img src="images/users.jpg" vspace="3" hspace="3">Membership</div></div>
Reply With Quote
  #9 (permalink)  
Old Aug 14th, 2006, 21:47
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Background image left and right of centered div

What's this supposed to be doing?
Code: Select all
<div id="nav"></div>
An 'id' is supposed to be unique on a page. I know you know this so why do you have two:
Code: Select all
<ul id='menu'>...
Look at your menu. The font is different on the second item. Presumably to indicate something, but it's neither active or a sub-menu or a sub-list.

ANd why do you have another menu on the right as a selection box? This just adds confusion for the end user.

Your code has a mix of lower and upper case tags.

Your menu is over-structured. Your menu block titles can also be an <li>, just a special one with an image and text.

I've said this to you before but I guess you didn't take it on board. You need to go and do a lot of reading and working through some good books and/or online tutorials.
Reply With Quote
  #10 (permalink)  
Old Aug 14th, 2006, 23:51
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Background image left and right of centered div

It would be a good idea to leave a hole in the background 2 pixels smaller than the centered DIV. If the browser width in pixels is an odd number, the background will be off by a pixel leaving a blank vertical line on either side of the content DIV.
Reply With Quote
  #11 (permalink)  
Old Aug 15th, 2006, 11:26
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Background image left and right of centered div

Quote:
Originally Posted by ukgeoff View Post
What's this supposed to be doing?

Code: Select all
<div id="nav"></div>
An 'id' is supposed to be unique on a page. I know you know this so why do you have two:
Code: Select all
<ul id='menu'>...

The nav div used to be in my stylesheet for the navigation on a previous site. Now i use it for the blue bar underneath the title banner image instead of using a blue bar image. Using a div saves on download time for the user.

As for the ul id="menu" that is for a Javascript expanding menu where one on the nav links can expand vertically so show related links. It currently does work properly in Firefox and I know why. I just need to find a solution. Have a look in IE and you will see
Reply With Quote
  #12 (permalink)  
Old Aug 15th, 2006, 17:02
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Background image left and right of centered div

Quote:
Originally Posted by AdRock View Post
The nav div used to be in my stylesheet for the navigation on a previous site. Now i use it for the blue bar underneath the title banner image instead of using a blue bar image. Using a div saves on download time for the user.

As for the ul id="menu" that is for a Javascript expanding menu where one on the nav links can expand vertically so show related links. It currently does work properly in Firefox and I know why. I just need to find a solution. Have a look in IE and you will see
With regard to your first comment, if that's the case, then your <div id=nav> should wrap around <div id='adam'> and not be just stuck on its own.

As far as your second comment goes, you are completely missing the point. The rules are that you can only have an 'id' occur once on a page. It is supposed to be UNIQUE. What ever you think you are doing with the navigation <ul>'s, you shouldn't have two with the same id.
Reply With Quote
Reply

Tags
background, image, left, right, centered, div

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
BG image centered afowler Web Page Design 3 Oct 16th, 2007 16:34
background image not big enough mykl Web Page Design 7 Oct 11th, 2007 19:08
background IMAGE"S" need one on left one on right bruno89 Web Page Design 11 Jan 28th, 2007 05:15
repeat a horizontally centered background image Legacy_Staff Web Page Design 12 Jul 14th, 2006 20:23
Background image overlaping footer image at bottom of div lw_d Web Page Design 4 Mar 21st, 2006 00:27


All times are GMT. The time now is 22:14.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43