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
\n<link rel=\"stylesheet\" type=\"text\/css\" href=\"csdeptb.css\" title=\"Blue Layout\" \/><\/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
\n<link rel=\"stylesheet\" type=\"text\/css\" href=\"csdepta.css\" title=\"Orange Layout\" \/><\/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
Main page (shifted right):<\/p>\n
Faculty page (shifted left):<\/p>\n
My forehead hurts in shame.<\/p>\n
To attempt to redeem myself, here’s a 30-second code snippet for centering stuff in CSS:<\/p>\n
<LINK REL=\"stylesheet\" TYPE=\"text\/css\" HREF=\"style.css\" \/><\/p>\n
<TABLE class=framework> <!-- Desire to center this table --><\/p>\n
body { text-align: center; } \/\/ Center for IE<\/p>\n
margin: 0px auto; \/\/ Center for Mozilla<\/p>\n
text-align: left; \/\/ Prevent IE hack from inheriting<\/p>\n