Paying for lazy coding practices
Posted: Wednesday, November 19, 2008 ~ 10:46 AM
I've made a small change to the layout of this site, doing away with the inline titles for posts.
The problem was that these titles were not the actual titles from the database, but rather duplicate text that was simply bolded. I can't remember why I started doing this: probably didn't have time to code it properly. Whatever the case, I'm paying for it now, since I now have extraneous text at the beginning of each post.
The result was that I had duplicate titles for each post. My temporary solution for this is to use the first-child pseudo-class to select the first bold/strong element in the entry and hide it. If you dig through the archives you'll see that this mostly works, except for the fact that I typically placed a space and a period outside the 'title'. These now appear at the beginning of most of my posts, and will stay there until I get around to manually cleaning them out of all my posts.
Also, since first-child isn't supported in IE <=6, the double-title problem will persist for anyone still using those browsers. An acceptble tradeoff for my personal site, but not something I would try at work.