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..
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?
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..
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.
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
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).