Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Unexpected CSS positioning

    My entire layout works fine. Except when I want to click on a link that takes me to an Anchor tag. Then most of my page shifts upwards in relation to my header.

    Take a look at www.midwestweb.net
    Click on the Company tab. Layout is ok.
    Next, click on the About Us item in the Company menu.

    I've looked it all over. I've compared browsers and it occurs the same on all. I think I've narrowed it down to a CSS issue, but can't find it.

    Maybe you can see what I cannot?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    I think the following is the culprit.
    Code:
    #wrapper {/*default.css (line 14)*/
    overflow:hidden;
    }
    If you are using it to clear your floats, you may need to switch into the other ways, see www.positioniseverything.net/easyclearing.html
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    nerk01 (11-19-2009)

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello nerk1,
    Is your link, About Us, somehow directed at the anchor #About.
    On the About page, you have
    Code:
    			<div id="outer5">
    				<div class="content">
    					<a name="About" />
    					<h3>About us:</h3>
    Your links Mission, Personel, and Careers open up to their respective sections also.


    A few more things I notice right off:
    Your #header is set to height: 144px;
    The .content, inside of #header, is 189px high so your box model is off.
    A good way to find those sort of errors is to apply different background colors to different elements and check that they enclose what you expect them to.
    Try removing the height from #header and let it expand to enclose whatever is in it.
    Once you fix the box model, overflow:hidden; won't be needed anymore.


    For me, the page also jumps to the right. Your index page is not tall enough for my browser to need a vertical scrollbar. When I click on About Us, the content of that page is long enough that the scrollbar appears which makes the page jump over to the left the 15px width of the scroll bar.
    The solution to that is to force the scrollbar, even when it's not needed, but adding the line height: 100.1%; to the CSS for your body.
    Last edited by Excavator; 11-19-2009 at 04:34 PM.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    nerk01 (11-19-2009)

  • #4
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    You're both right about the overflow.

    I've corrected the overflow, but it introduced a new problem.

    The three columns below my rotating image now don't stay attached to the footer. I was using this line:
    Code:
    #outer1, #outer2, #outer3 , #outer4, #outer5 {padding-bottom:32767px; margin-bottom:-32767px;}
    to accomplish that, but with the overflow on that makes the page really long.

    Also I tried to add the height=100.1% to the body, but it didn't work.

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Oops, sorry.
    This works -
    Code:
    html, body {font-size:76%; font-family:"trebuchet MS", verdana, arial, sans-serif; background:#fff; height: 100.1%;}
    see the demo
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #6
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    Oops, sorry.
    This works -
    Code:
    html, body {font-size:76%; font-family:"trebuchet MS", verdana, arial, sans-serif; background:#fff; height: 100.1%;}
    see the demo
    I didn't add to the html, now it works, thanks!

    Now if only I could fix the columns to always size until they hit the footer.

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by nerk01 View Post
    Now if only I could fix the columns to always size until they hit the footer.
    On your index page, does this work for you?
    Code:
    #outer1, #outer2, #outer4 {
    height: 250px;
    }
    If not, you will need to look into faux columns.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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