Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
centering a bg image, safari vs. firefox
Old 08-07-2008, 02:58 PM centering a bg image, safari vs. firefox
Junior Talker

Posts: 2
Name: Eric
Trades: 0
Hello,

I'm trying to make a CSS page where I have a background image that lines up with some form fields on the page. I need the whole thing to be centered horizontally- so that when you resize the browser window, the form fields move with the background image. I've managed to get it to work fine in Safari, but in FF, the form fields jump across the page and the bg stays fixed when I resize the browser window. First I'm trying to figure out how to get the bg to move, then I'll worry about the forms. Here is some of my CSS:

Safari (first is the background image, second is content, third is a form field):

#backgroundWrap {
background-image: url('background.jpg');
background-position-x: -80px;
position: absolute;
top: 0px;
left: 0px;
min-height: 916px;
width: 50em;
}

#content {
width: 1100px;
position: relative;
top: 55px;
}

#emailField {
position: absolute;
top: 232px;
left: 435px;
width: 195px;
}



Firefox:



#backgroundWrap {
background-image: url('background.jpg');
background-position-x: -80px;
position: relative;
top: 0px;
left: 0px;
width: 1550
}

#content {
width: 1100px;
height: 1200px;
position: relative;
top: 55px;
scrolling: yes;
}

#emailField {
position: absolute;
top: 300px;
left: 510px;
width: 195px;
}
levinhatz is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-07-2008, 03:47 PM Re: centering a bg image, safari vs. firefox
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Lose all that position:absolute. How do you expect anything to 'flow' when you've removed almost everything from that flow ??
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-07-2008, 04:58 PM Re: centering a bg image, safari vs. firefox
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
To center a background image, all you do is this:
background-position: center top;
or
background-position: center center;
or
background-position: center bottom;
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 08-11-2008, 01:32 PM Re: centering a bg image, safari vs. firefox
Junior Talker

Posts: 2
Name: Eric
Trades: 0
Thanks everyone for your help.

Is it possible to do the same thing for a group of objects on the page? I'd like my form fields to move with the background image when you resize the window.

Thanks!
levinhatz is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to centering a bg image, safari vs. firefox
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23137 seconds with 12 queries