Old 02-03-2008, 16:58   #1 (permalink)
z_coil
Registered User
 
Join Date: Mar 2007
Posts: 10
CSS Help Positioning

Hello all,

I am in need of some CSS help. I have a page I am building that uses a small background pattern (1600x20px) that simply repeats over and over, that works perfectly. The pattern has a dark gradient on the left and right sides and has a grey in the middle. The grey is where my content will go. Now, I am trying to position elements onto that content area, but I cannot figure it out. The research I have done says I should use relative positioning, but I don't know how to get one object to position relative to that grey content area. Any words of advice?

Kevin
  Reply With Quote
Old 02-03-2008, 17:06   #2 (permalink)
herkalees
Semantics, yay.
 
herkalees's Avatar
 
Join Date: Nov 2005
Location: Salem, Massachusetts
Posts: 1,077
The one element that you've set the repeating background on... is it a fixed width? (I'm assuming it is). If so, simply add some padding, like this:

Before:
#elementName {
width: 800px;
background: url(path/to/repeatingImage.jpg) repeat-y left top;
}

After:
#elementName {
width: 750px;
padding-right: 25px;
padding-left: 25px;
background: url(path/to/repeatingImage.jpg) repeat-y left top;
}

Just remember that the padding values, plus the width value, need to add-up to the original width. In my fake example, 750px + 25px + 25px = 800px.
__________________
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8