开发者

Weird problems with CSS position:absolute

I am having som开发者_高级运维e really weird problems with position:absolute. I have set the main title of my webpage to be position absolute, but when I resize the window, the text moves around. The really weird thing is that the tagline (the Bible verse) is also position:absolute, but it isn't having any problems. Any suggestions?


I'm guessing your screen resolution is 1920x1080? Looks like you've gone and positioned the element relative to the window, which only works if the window is that size.

Try removing the position: absolute and the right properties, and using float:right instead of float:left.

As for the tagline element, you made it position: relative and float: right. position: relative, here, does absolutely nothing.


I suggest adding the position: relative to the #logoWrapper:

#logoWrapper {
    ...
    position: relative;
    ...
}

Thus its children with position: absolute will be positioned relatively to the #logoWrapper, not the body, as Kolink said.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜