{"id":173,"date":"2007-02-18T10:36:00","date_gmt":"2007-02-18T18:36:00","guid":{"rendered":"http:\/\/www.mccambridge.org\/blog\/2007\/02\/its-the-scrollbar-idiot\/"},"modified":"2022-09-11T00:40:44","modified_gmt":"2022-09-11T00:40:44","slug":"its-the-scrollbar-idiot","status":"publish","type":"post","link":"http:\/\/www.mccambridge.org\/blog\/2007\/02\/its-the-scrollbar-idiot\/","title":{"rendered":"It's the scrollbar, idiot!"},"content":{"rendered":"
Update:<\/strong> As Craig pointed out, the original version of my page flashed blue before changing orange. That was my bad. Here’s what was wrong, as an FYI:<\/p>\n Original Stylesheets:<\/p>\n <link rel=\"stylesheet\" type=\"text\/css\" href=\"csdepta.css\" title=\"Orange Layout\" \/><\/p>\n ...<\/p>\n <body onload=\"setActiveStyleSheet('Orange Layout');\"><\/p>\n <\/code><\/p>\n The problem? Both stylesheets were loaded by default as preferred stylesheets, and since the blue sheet is listed first, it took precedence, rendering the page blue. Then on page load, I fired off a javascript call to set the orange sheet as active. This was to work around a weird IE glitch where it didn’t always load the second style sheet. BUT, this resulted in the page being blue until it fully loaded, and then changing orange. The solution? List orange first, and make the blue an alternate stylesheet, like so:<\/p>\n <link rel=\"alternate stylesheet\" type=\"text\/css\" href=\"csdeptb.css\" title=\"Blue Layout\" \/><\/p>\n ...<\/p>\n <body onload=\"setActiveStyleSheet('Orange Layout');\"><\/p>\n <\/code><\/p>\n [\/Update]<\/strong><\/p>\n So I’ve been having fun over the past couple days playing with HTML and CSS for a CS 640 (Intro to Computer Networks) assignment. The assignment is pretty trivial: basically, create the homepage for a fictitious Computer Science department. The home page should include 3 HTML documents (a home page, a faculty page, and a course listing), and two interchangible Cascading Stylesheets to play with colors. I put the shell of the page together pretty quickly, and then I’ve been spending some time playing with fancy CSS effects instead of doing my circuits homework \ud83d\ude42<\/p>\n The page, for any who are interested, is located here: CCM University’s Computer Science Department<\/a><\/p>\n One annoying “bug” I kept running into was that my nicely-centered TABLE (yeah, I know… <TABLE>s are SO<\/em> Web 1.0. Get over it.) kept shifting slightly to the right on the main page (index.html), and then back slightly to the left on the other two pages. I looked into this for probably 30 minutes, trying to find some extraneous tags or something that were screwing up the spacing.<\/p>\n (It’s a little hard to see on the thumbnails, but note the scrollbar appearing. The motion is easy to see in the fullsize pics.)<\/em><\/p>\n Main page (shifted right):<\/p>\n
\n<link rel=\"stylesheet\" type=\"text\/css\" href=\"csdeptb.css\" title=\"Blue Layout\" \/><\/p>\n
\n<link rel=\"stylesheet\" type=\"text\/css\" href=\"csdepta.css\" title=\"Orange Layout\" \/><\/p>\n