Results 1 to 3 of 3

Thread: content alignment with fixed div above

  1. #1
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default content alignment with fixed div above

    I figured it out. Almost all of my problems were being caused by a typo in the content-type meta tag. thanks for the help.

    Page in Question

    I've got a page with a div fixed at the top of the window (contains the site menu) and a content div below it. the whole thing is centered.

    Problem: when I use:
    Code:
    #content{
    	margin: 0 auto;
    	text-align: center;
    	width: 700px;
    	padding: 0;
    	}
    it works fine in IE, but in FF, the content goes to the top of the page, behind the menu div.

    When I use:
    Code:
    #content{
    	margin: 0 auto;
    	text-align: center;
    	width: 700px;
    	padding: 0;
    	position: absolute;
    	top: 200px;
    	left: auto;
    	right: auto;
    	}
    it's fine in FF but in IE, the content is pushed partway off the right side of the screen.

    I've tried several other positioning, padding, margin, etc. combinations, but I can't seem to solve both browsers' problems at once. Any suggestions? Thanks, everyone.
    Last edited by traq; 10-18-2008 at 04:29 AM.

  2. #2
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    then use this one in your stylesheet...

    Code:
    #content{
    	margin: 0 auto;
    	text-align: center;
    	width: 700px;
    	padding: 0;
    	position: absolute;
    	top: 200px;
    	}
    then put this in the <head> of your page in question...

    Code:
    <!--[if IE]>
    <style type="text/css">
    #content{
    	margin: 0 auto;
    	text-align: center;
    	width: 700px;
    	padding: 0;
            position: absolute;
    	top: 200px;
    	}
    </style>
    <![endif]-->
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  3. #3
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    I assume you mean
    Code:
    <!--[if IE]>
    <style type="text/css">
    #content{
    	margin: 0 auto;
    	text-align: center;
    	width: 700px;
    	padding: 0;
    	}
    </style>
    <![endif]-->
    (which works in IE) in the head of the page and
    Code:
    #content{
    	margin: 0 auto;
    	text-align: center;
    	width: 700px;
    	padding: 0;
    	position: absolute;
    	top: 200px;
    	left: auto;
    	right: auto;
    	}
    (which works in FF) in the stylesheet? Tried it, but it doesn't work. I also tried it exactly how you posted (just in case), but no go either. Any other ideas?

    Another odd thing that just popped up is that the drop-down submenus are now transparent in IE, but not in FF.

Bookmarks

Posting Permissions

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