daviesgeek
daviesgeek

Reputation: 831

Weird problems with CSS position:absolute

I am having some 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?

Upvotes: 0

Views: 108

Answers (2)

dmedvinsky
dmedvinsky

Reputation: 8336

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.

Upvotes: 1

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324600

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.

Upvotes: 2

Related Questions