Results 1 to 6 of 6

Thread: Css fixed position problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    Smile Css fixed position problem

    hi guys, any one can give an idea for this problem.. i had this code..
    Code:
             <STYLE type="text/css" media="screen">
         
           div#fixtop
             {
             margin-top:400px;
             position:fixed;
             }
             </style>
    and call this one on html like this
    Code:
       
         <div id="fixtop" >
       
          <A href="#pagetop">Page Top </A>
       
          </div>
    above code works fine..but if i change the margin-top to 600px the text is not displayed on the screen.. any ideas for this? why if the margin-top value is increased text is not visible... thanks..
    The taller the bamboo grows the lower it bends...

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Css fixed position problem

    You are moving the div down the page when you use margin-top. Do you really need to use margin-top for what you are attempting to achieve?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    Re: Css fixed position problem

    yes, i want to put margin-top at that particular height at 600px..or is there any work around on this? or it's not possible...thanks for the reply..
    The taller the bamboo grows the lower it bends...

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Css fixed position problem

    Using the following the link falls just off the page:

    HTML Code:
             <style type="text/css" media="screen">
         div#fixtop      
    		 {
             margin-top:600px;
             position:absolute;
             }
             </style>
    Edit:

    Maybe reduce 600 to 550?

    Reducing margin-top to 550px will put the link at the bottom of the page (without scrolling) exactly if you are using a display of 1024 by 768 pixels. If you are using a different resolution just change "550" to suit.
    Last edited by Nightwalker83; Sep 27th, 2009 at 01:57 AM. Reason: Adding more!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    Re: Css fixed position problem

    Hi, thanks for the help..i find a workaround using jquery...from this site..
    http://stackoverflow.com/questions/1...-which-part-of
    The taller the bamboo grows the lower it bends...

  6. #6
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: Css fixed position problem

    Instead of top use bottom:
    Code:
    div#fixtop
             {
             bottom: 0;
             position:fixed;
             }
    Other than that you just have to live with JavaScript (or jQuery).

Posting Permissions

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



Click Here to Expand Forum to Full Width