Sebastian
Sebastian

Reputation: 3628

Why are these two pages displaying differently?

Homepage About page: /about.html CSS: /saucy.css

I'm sure I'm overlooking something obvious, but I can't seem to find it.

Both of these pages stem from the same HTML skeleton and use the same CSS file for formatting. Why does the About page centre differently to the homepage?

Thanks!

Upvotes: 0

Views: 99

Answers (2)

KatieK
KatieK

Reputation: 13853

Your Homepage has enough content that it gets a vertical scrollbar, but your About page does not. (The same thing was going on here: CSS pages not equal even with the same css-file.)

Here are some options to consider:

  • Add overflow:scroll; to each page's stylesheet, (on the body element, for example). A scrollbar will always be rendered even when it's not necessary, and your layout will not move around.
  • Don't center your content; specify a left margin in ems or pixels.

Upvotes: 0

Tom Smilack
Tom Smilack

Reputation: 2075

They center the same for me, but I suspect that for you it's because of the scroll bar. The home page is taller, so the scroll bar on the right pushes everything left. The about page has no scroll bar so it's actually in the middle of the screen.

Upvotes: 2

Related Questions