iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-19-2008, 10:49 PM
WebProWorld Pro
 
Join Date: Jul 2003
Location: Canada
Posts: 272
ackerley1 RepRank 0
Default Yet another CSS Cross browser issue

Updating a site and again have stumbled upon a quirk between IE(7 specifically) and FF that I cannot seem to resolve.

Reef Village 2008 v1

In FF the "grey" content box is where it should be - aligned with the left of the Orange logo box and the bottom of the top blue band.

In IE7 the "grey" box is to the right of the orange logo box when it is directly under the blue, but if you shift it to the align with the left of the logo box it is not directly under the blue band.

Any ideas? Is there a way around this without resorting to IE conditionals?
__________________
Rob
Reply With Quote
  #2 (permalink)  
Old 11-20-2008, 10:54 AM
Dubbya's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Nov 2006
Location: Steinbach, Manitoba, Canada
Posts: 1,300
Dubbya RepRank 4Dubbya RepRank 4Dubbya RepRank 4Dubbya RepRank 4Dubbya RepRank 4
Default Re: Yet another CSS Cross browser issue

It's a pretty simple fix.

HTML Code:
#logo {
	float:left;
	position:relative;
	top: -102px;
	margin-bottom:-164px;
	
}

#content_container {
	background-color:#CCCCCC;
	margin-left:3px;
	height:400px;
	clear:both;
}
I set the content div to clear under the logo, allowing it to move left, then applied a negative bottom margin on the logo to "pull" the content div up vertically.

The content container also has a 3 pixel left margin applied so that it aligns more precisely with the left edge of the logo.

FYI: With this code, the logo div will rest above any text or images you place in the content area, so text will flow behind it.

I'm assuming that your navigation menu will reside directly beneath the logo. If that's the case, you can use the following to constrain your paragraph text so that the main content stays to the right of it.

HTML Code:
p {margin-left:230px; margin-right:20px;text-align:left;}

#logo {
	float:left;
	position:relative;
	top: -102px;
	margin-bottom:-164px;
	
}

#content_container {
	background-color:#CCCCCC;
	margin-left:3px;
	padding-top:10px;
	height:400px;
	clear:both;
}
You'll also note that this works in IE6, IE7, FireFox, Opera, Safari for Windows and Google Chrome.

Enjoy!

Last edited by Dubbya; 11-20-2008 at 11:27 AM.
Reply With Quote
  #3 (permalink)  
Old 11-20-2008, 10:58 AM
Dubbya's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Nov 2006
Location: Steinbach, Manitoba, Canada
Posts: 1,300
Dubbya RepRank 4Dubbya RepRank 4Dubbya RepRank 4Dubbya RepRank 4Dubbya RepRank 4
Default Re: Yet another CSS Cross browser issue

One thing that puzzles me is the character set declaration in your style sheet.

HTML Code:
@charset "utf-8";
Why would you need that if it's already declared in the head of the web page?

HTML Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Reply With Quote
  #4 (permalink)  
Old 11-20-2008, 11:03 AM
WebProWorld New Member
 
Join Date: Apr 2008
Posts: 16
Vaijero_Maya RepRank 0
Default Re: Yet another CSS Cross browser issue

mmmm looks good to me (IE
__________________
La Ruta Maya, My journey across Mesoamérica.
Guatemala Guides My trips around Guatemala.
Reply With Quote
  #5 (permalink)  
Old 11-20-2008, 04:47 PM
WebProWorld Pro
 
Join Date: Jul 2003
Location: Canada
Posts: 272
ackerley1 RepRank 0
Default Re: Yet another CSS Cross browser issue

Wow... never even thought of a negative Margin Thanks for that!

Nav will actually be to right of logo...

Not sure on the utf8... DW defaults that into there... and i figured it did no harm...


thanks for the help!!
__________________
Rob
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross Browser? Its the same old same old kula Graphics & Design Discussion Forum 0 04-24-2007 03:19 PM
Cross browser issues, part 2 ADAM Web Design Graphics & Design Discussion Forum 3 06-29-2005 02:14 PM
Test Site - Macs & PC's, cross browser/resolution/et matauri Graphics & Design Discussion Forum 32 09-07-2004 04:29 PM
Cross Browser Help elso Web Programming Discussion Forum 5 07-26-2004 01:38 PM
AOL cross browser compatible? twopooches Graphics & Design Discussion Forum 0 03-09-2004 06:36 PM


All times are GMT -4. The time now is 09:08 AM.



Search Engine Optimization by vBSEO 3.3.0