Submit Your Article Forum Rules

Results 1 to 5 of 5

Thread: Yet another CSS Cross browser issue

  1. #1
    Senior Member
    Join Date
    Jul 2003
    Posts
    293

    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

  2. #2
    WebProWorld MVP Dubbya's Avatar
    Join Date
    Nov 2006
    Location
    Steinbach, Manitoba
    Posts
    1,323

    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!

  3. #3
    WebProWorld MVP Dubbya's Avatar
    Join Date
    Nov 2006
    Location
    Steinbach, Manitoba
    Posts
    1,323

    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" />

  4. #4
    Junior Member
    Join Date
    Apr 2008
    Posts
    17

    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.

  5. #5
    Senior Member
    Join Date
    Jul 2003
    Posts
    293

    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

Similar Threads

  1. CSS Menu + Cross Browser issues
    By ackerley1 in forum Graphics & Design Discussion Forum
    Replies: 5
    Last Post: 02-12-2010, 05:21 AM
  2. Cross Browser? Its the same old same old
    By kula in forum Graphics & Design Discussion Forum
    Replies: 0
    Last Post: 04-24-2007, 02:19 PM
  3. Cross browser issues, part 2
    By ADAM Web Design in forum Graphics & Design Discussion Forum
    Replies: 3
    Last Post: 06-29-2005, 01:14 PM
  4. Cross Browser Help
    By elso in forum Web Programming Discussion Forum
    Replies: 5
    Last Post: 07-26-2004, 12:38 PM
  5. AOL cross browser compatible?
    By twopooches in forum Graphics & Design Discussion Forum
    Replies: 0
    Last Post: 03-09-2004, 05:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •