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

    Question Problem about fixed position

    Good afternoon everyone..
    I have a problem..
    Look at this first :

    This is the condition before i changed the topwrap into fixed position

    And, look at this :

    This is the condition after i changed the topwrap into fixed position

    The logo moves to top.. (see the image)
    But, I want the logo to stay in the original position (like the one in capture.png)
    Can someone help me to make it not move to top ??

  2. #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Thanked 1,874 Times in 1,858 Posts
    Hello terryds,
    When you make .topwrap fixed, it effectively removes that element from the flow of the document so .header doesn't see it.

    The solution is a top margin on .header to push it down enough to clear .topwrap.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use a DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  3. #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 932 Times in 919 Posts
    You will also need to consider whether you want the top wrap content to be in front of or behind the main content of the page when you scroll that content.

    The easiest way to make sure it is above the main content is to define it last in the page.
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


Posting Permissions

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