Saturday, December 25, 2004

CSS not working on a .Mac homepage? Here's one solution

Category: Mac, Category: dot Mac

Originally posted on my iBlog 8 January 2005.

Summary: Apple's .Mac service includes a bundle of web tools (email, homepage), server space (iDisk), and software, all elegantly integrated into Mac OSX. Regrettably, website hosting through .Mac is limited with no PHP or MySQL support. I also had trouble implementing CSS on a custom webpage. Here's what was going wrong (or, more accurately, a way around the problem).

Body: CSS (Cascading Style Sheets) greatly simplifies the formatting of websites (and allows the management of the formatting of multiple webpages from a single file). Homepage, the stunning easy online webpage creation software of the .Mac service, is not designed with this complexity in mind. But adding a custom webpage to my .Mac website is easy. I just write the code and save the file to the Sites folder of the iDisk. That's it.

I spent ages trying to get a CSS page to work with my jon.html page, which I have living at the root of my Sites folder in my iDisk. After a lot of wasted time, I figured out by accident that the CSS page will not work when it is in the root folder of the website. When I copied the CSS page into the Science folder inside the Sites folder, and referred to it in there, everything worked fine. Quite bizarre. I couldn't find reference to this anywhere on the Appe website or elsewhere the web. But things work fine now.

As an aside, note that it is with CSS that I format my references with a hanging indent, standard in reference lists of science papers. CSS allows for more formatting control than HTML. I'm very much still learning its tricks. This one was a good one.

Here's the line in my CSS page that sets how the references are laid out.

P.REFERENCE
{
margin-left: 10%;
margin-bottom: 0%;
text-indent: -4%;
}

0 Comments:

Post a Comment

<< Home