bookmarks.html is busted
by ZetaGecko | 1 Comment | Internet, Issues/Problems
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;
}
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.
October 30th, 2005 at 4:13 pm
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 (google "userContent.css" for more info on that). The style for my bookmarks gets enclosed within the following (you'll change this to specify your bookmarks location):
@-moz-document url(file:///C:/Documents%20and%20Settings/1/Application%20Data/Mozilla/Firefox/Profiles/099s1nfv.default/bookmarks.html)
{
}
It's not easy to stylize bookmarks.html, though. I've given it a good six hours of effort and given up. The html is not at all well-formed, and the structure of its nesting makes css difficult. Maybe you can produce some more likable css that I could. Good luck.