开发者

CSS Related: Trying to position a div styled to look like a bar on a wepage

I'm trying to position a div tag on my page absolutely so no matter if you resize the page or not the div does not move position. . I've used absolute positioni开发者_Python百科ng in both the div tag and in some JQuery .css({position:absolute}), It still moves when i resize the screen. quite annoying.


You want to use position: fixed however that is not supported by IE 6 and lower so you have to apply some tricks to make position: fixed work in IE;


CSS:

position: fixed


From what I understand from your question, it sounds like you need position: fixed

Position absolute will position the element absolutely within its parent (more or less), and will still move when the page is scrolled.

Position fixed will position the element at the same place within the window, no matter whether you scroll or not.

Show us what you have, because I may have misunderstood your question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜