Justin Paul Silva

Web design, development, & more

Specifying Tab Stop Width

Posted on

I recently scoured the internet, looking for a way to specify the width of a tab stop (\t) in CSS. It turns out that CSS doesn’t offer any sort of solution. You may be asking, “Why would you even want to do that? After all, browsers ignore whitespace in HTML.” That’s true, unless of course you’re using a pre tag or any other tag with the whitespace set to pre in CSS, like the code examples on this site. What we’ll do is use Javascript to search the element fo ... read on

Clean URLs Part 2

Posted on

My previous article, Clean URLs with htaccess shows a very basic way of going about cleaning up your URLs. Now, let’s assume that not all of your pages are meant to look or act the same. How can we use different keywords, title, and description on each page? How can we use different Javascript or CSS files on different pages? How can we use add different header content for one or more pages? clean.php This is what a typical PHP file will look like. We will store the title, keywords, e ... read on

Clean URLs with htaccess

Posted on

Here’s a bit of code I use on most of my smaller sites, including this one, to clean up the URLs. This is the simplest way I know how to do it. A few benefits of clean URLs: They just look nicer and more professional They’re easy to read and remember The average web user doesn’t care about webpage file extentions, nor should they It hides the underlying technology The URLs become more SEO friendly It allows you to use cleaner code .htaccess <IfModule mod_rewrite.c> ... read on

3D Javascript Effect

Posted on

Here’s a little Javascript effect that will give your site a subtle 3D look by simulating a parallax between the content of your site and the background. Try out the effect now by scrolling up and down on my site. CSS only gives us two choices for background-attachment: scroll (default) and fixed. This script is sort of halfway between the two by making the background scroll half as fast as the content. $(function(){ $("body").css("backgroundAttachment", "fixed"); $(window).scroll(funct ... read on