We've moved!

TechKnack.blogspot.com has officially moved to TechKnack.net. You should be redirected in 3-5 seconds. Thank you.

July 15, 2008

Konqueror's "Create new" Menu under KDE4

Add this post to Del.icio.us. Del.icio.us (0 saved)

A while ago, I posted how to edit Konqueror's "Create New" menu. Unfortunately, installing the KDE4 desktop seems to nullify this trick. This is because KDE4 redirects Konqueror from /usr/share/templates to /usr/lib/kde4/share/templates . Annoying, really. There are two solutions.

First solution is to copy your files from /usr/share/templates to /usr/lib/kde4/share/templates . Then either stop worrying about /usr/share/templates, or sync them whenever a change is made.

Second solution is to symlink (create a shortcut to) /usr/share/templates from /usr/lib/kde4/share. To do this, first move /usr/lib/kde4/share/templates to a "backup" state (like /usr/lib/kde4/share/templates.old ): sudo mv /usr/lib/kde4/share/templates /usr/lib/kde4/share/templates.old Then create the shortcut: sudo ln -s /usr/share/templates /usr/lib/kde4/share/ And voila, you are back to maintaining one directory.

July 12, 2008

Sticky Page Footers

Add this post to Del.icio.us. Del.icio.us (0 saved)

Occasionally you'll be coding out a site, and you want a "sticky footer", a footer that sticks to the bottom of the browser viewport or the bottom of the main content section, whichever is lowest.

There are a few notable sites that have posted methods for doing this, but the short answer is it doesn't work unless you meet certain requirements. Probably the most popular example (which is also the first google result for "sticky footer") is A CSS Sticky Footer. However, as the explanation page shows, the method uses extraneous markup to push the footer down below the content. Also, this method only works with static-height footers.

Another good example comes from AListApart: Exploring Footers. The method involves using relative positioning on a container and absolutely positioning the footer to the bottom of that container. Inexplicably, this works, though for my implementation, I used the body element as my wrapper. Unfortunately, you have to apply appropriate padding or margin to the bottom of the content div, which in turn squashes the idea of having a dynamic-height footer.

Given these examples, which are perfect for fixed-height footers, it seems sticky, dynamic-height footers are not meant to be under current browser implementations. If you're insistent on having a dynamic-height sticky, you'll have to go the way of the faux footer (along the lines of the faux columns, which I've always thought to be cheating :) ). I couldn't find any links talking about faux columns (in this sense, anyway), but one site which currently implements it is KilianValkhof.com. If you look into his code, you'll see that the background of the footer is actually set in the body.