Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 09-14-2007, 01:48 AM
Fruit & Veg's Avatar
Senior Member
 
Join Date: 10-13-03
Location: UK
Posts: 281
iTrader: 2 / 100%
Unhappy CSS Relative Positioning Difference Between IE and FF

I'm starting to put together a site and I'm trying to overlay the logo on top of the design. The logo is awkwardly overhanging both the header and the main body elements, so I need to overlay the image.

Here's the test page so far - http://www.thebrandsurgery.co.uk/testsite/ - it's fine in FF2 but it's about 10px down in IE7.

I've tried searching for hacks and answers but nothing is working. How can I get this image to appear correct in both browsers?

Here's the CSS I'm using:

Quote:
html, body {margin:10px; padding:0; font: 76% arial,sans-serif; text-align:center;}

p {margin:0 10px 10px;}
a {display:block; color: #006; padding:10px;}

hr {border:0; width: 100%; color: #ec0c8c; background-color: #ec0c8c; height: 1px;}

div#container {text-align:left; width:700px; margin:0 auto; padding:0;}

div#header {float:right; width:660px; padding-top:80px; padding-bottom:3px; border-bottom: 3px

solid #ec0c8c;}

div#pinkbar {width:650px; float:right; background:#ec0c8c; padding:5px; margin:0;

color:#ffffff; text-align:right; font: 14px arial bold;}

div#logo {position: relative; top:-356px; left:70px; margin:0; padding:0;}

div#content {float:right; width:660px;}

div#navigation {background:#B9CAFF; float:left; width:40px;}

div#extra {background:#FF8539; float:right; width:660px;}

div#footer {background:#ffffff; float:right; width:660px;}
Maybe there's a better approach for acheiving this? Let me know
__________________
Individualitee - Great Tshirts
USBtastic! - USB Gadget Blog
 
Reply With Quote
  #2 (permalink)  
Old 09-14-2007, 04:23 AM
Fruit & Veg's Avatar
Senior Member
 
Join Date: 10-13-03
Location: UK
Posts: 281
iTrader: 2 / 100%
OK, ignore the above.

I've been playing around and nothing is working. That page is now setup how I want it. The logo is at the bottom but I want it to be overlayed at the top of the pink nav bar so it lines up. It overlays two divs, plus it needs to remain in the same place for different sized browsers - this is the killer.

Any ideas?
__________________
Individualitee - Great Tshirts
USBtastic! - USB Gadget Blog
 
Reply With Quote
  #3 (permalink)  
Old 09-16-2007, 05:57 AM
kos's Avatar
kos kos is offline
Coding Tiger
Latest Blog:
Happy New Year 2013

 
Join Date: 04-13-07
Location: .ro
Posts: 4,030
iTrader: 3 / 100%
First thing first:
I saw you're using the same ID on multiple divs to identify them (that is to apply styles to them)... This is wrong! Use CSS classes for that. An ID should identify a single element in your page not multiple elements.

Anyway, I've been playing around with your code and I came up with this, so this is how you want it to look like?
Attached Thumbnails
CSS Relative Positioning Difference Between IE and FF-ie.jpg   CSS Relative Positioning Difference Between IE and FF-ff.jpg   CSS Relative Positioning Difference Between IE and FF-ns.jpg   CSS Relative Positioning Difference Between IE and FF-opera.jpg  
 
Reply With Quote
  #4 (permalink)  
Old 09-16-2007, 08:20 AM
chicgeek's Avatar
Contributing Member
 
Join Date: 08-19-04
Location: Canadian on the left coast
Posts: 14,199
iTrader: 0 / 0%
Quote:
Originally Posted by Costin Trifan View Post
First thing first:
I saw you're using the same ID on multiple divs to identify them (that is to apply styles to them)... This is wrong! Use CSS classes for that. An ID should identify a single element in your page not multiple elements.
To add:

ID = single assignment
class = multiple assignments

Not sure if you need a IE positioning hack, but I tend to use this:

margin-bottom: 0px; (all browsers see this)
*margin-bottom: -2px; (only IE sees this and fixes itself)
__________________
laura / chicgeek
soprano & web designer
@chicgeek on Twitter
laurakishimoto.ca
 
Reply With Quote
  #5 (permalink)  
Old 09-17-2007, 12:47 AM
bratwebdesign's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 04-05-06
Location: Nebraska
Posts: 253
iTrader: 0 / 0%
To overlay the logo do this:

Change div#container to this: (I only added position: relative

Code:
div#container { text-align : left; width : 700px; margin : 0 auto; padding : 0; position: relative; }
Then to div#logo: (added position, top and left)

Code:
div#logo { position : absolute; top : -5px; left : 40px; width : 157px; margin : 0; padding : 0; }
I tested this on IE6 and FF2 at different screen resolutions and it worked perfectly. I would change the logo to a gif without the background though.

Hope this helps.
Attached Thumbnails
CSS Relative Positioning Difference Between IE and FF-ie.gif  
__________________
Omaha Web Design | Cube Directory

Last edited by bratwebdesign; 09-17-2007 at 12:59 AM.
 
Reply With Quote
  #6 (permalink)  
Old 09-17-2007, 04:57 AM
kos's Avatar
kos kos is offline
Coding Tiger
Latest Blog:
Happy New Year 2013

 
Join Date: 04-13-07
Location: .ro
Posts: 4,030
iTrader: 3 / 100%
Ok, ignore my post too!

note for myself:
never get involved into these kind of problems anymore
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is truth relative? John Scott Controversial Social Issues 239 02-13-2008 09:51 AM
Relative positioning with CSS lajones3 Coding Forum 4 02-01-2007 03:39 AM
relative ads tytyguy Google Forum 0 08-07-2006 09:15 AM
Relative URL Question realestate Web Design Lobby 4 12-05-2004 03:17 PM
CSS positioning vs. table positioning downtroden Coding Forum 2 07-19-2004 11:40 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 10:13 PM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.