The bookmarks file generated by Mozilla is busted. The other day, I tried to create an XHTML file to turn my bookmarks file into a CSS-powered cascading menu, but I ran into a problem: since bookmarks.html doesn't have closing tags for many of its elements, I couldn't get the CSS styles applied as desired. Mozilla--please convert your bookmarks file to XHTML to enable this kind of thing.

Here's what my XHTML file loked like (yeah, I know, I'm missing the XML delcaration and DOCTYPE):

<html>
<head>
<title>Antone's Bookmarks</title>
<link rel="stylesheet" type="text/css" href="bookmarks.css" />
</head>
<body>

<object
data="file:///asdf/Mozilla/Profiles/qwerty/foobar/bookmarks.html"
type="text/html"
style="height:400px;width:100%;">
</object>

</body>
</html>

The whole purpose of this file is to apply a stylesheet to bookmarks.html. Thus, it links to a stylesheet, and uses the "object" element to import my bookmarks file.

Here's my bookmarks.css file:

body {
background:#fff;
}

dl {
display:block;
margin:0;
padding:0;
list-style:none;
width:150px;
border-bottom:1px solid #03c;
position:absolute;
left:0px;
top:19px;
font-weight:normal;
text-align:left;
}

dl dl { display:none; }

dl dl {
left:149px;
top:0;
}

dl dt { position:relative; }

a {
display:block;
text-decoration:none;
color:#fff;
background:#03c;
padding:3px 5px;
border:1px solid #03c;
border-bottom:0;
}

a:hover {
color:#039;
background:#eee;
text-align:left;
}

dl:hover>p>dl { display:block; }
dl:hover { text-align:left; }

dd {
display:none;
}

Reader Comment:
Anonymous said:
Although it's been a few months since you wrote this, maybe you're still interested. There actually is a way to impose css on your bookmarks.html. You'll need to make a file called userContent.css in the chrome folder, which is in your profile folder...
(join the conversation below)

I'm not sure whether this is exactly how it should look--since it didn't work, I couldn't test it. But it's adapted from a stylesheet that converts unordered lists into cascading menus, so it's certainly close.

Oh well, maybe someday.