Using Numbers as CSS Class or ID Values
Written on 11/20 • 0 CommentsThis week I found myself in a situation where I needed to apply CSS to an element only on a specified page. The best way to do this is to add an id to the body tag of the said page thus allowing you to apply a style only to that page. The example below shows an ID applied to the body tag. This is good practice when building your sites but sometimes easier said then done when using a Content Management System to dynamically generate your pages.
<body id="home">
The following CSS will apply only to paragraphs on the home page making them red.
body#home p { color: red; }
How to Prevent or Allow Directory Listing
Written on 11/13 • 0 Comments
Having a list of files in a directory on your site sometimes is useful. You may for example want a directory you can upload large files to for others to download without wanting to spend time creating a fancy PHP (or your preferred language) interface. It is important to understand the security implications of allowing directory listings. Listing files in directories that contain your code will make it easier for someone to compromise your site. We recommended you restrict listings to specific folders. You can easily control this behavior on your Apache server using one simple line in a .htaccess file.
Continue ReadingUsing SSH in Terminal.app on Mac OS X
Written on 10/30 • 0 Comments
This article will teach you how to open a SSH connection using the Terminal application in OS X. OS X's UNIX background means there is an easy way to exchange data with your Linux/UNIX web server using the built in Terminal application. SSH, if enabled, allows you to remotely execute commands on your webserver that can be helpful for all sorts of purposes.
Continue ReadingHow to Create a WebClip Bookmark Icon for your Site
Written on 10/16 • 0 Comments
Apple allows iPhone and iPod Touch users to add bookmarks to the home screen of their device. These bookmarks can be added for any web page and appear as an icon on the home screen. Apple calls these WebClip Bookmarks. By default, the icon used for this home screen is a thumbnail screenshot of the page in question, but Apple have provided a mechanism for site owners to specify an icon to be used instead.
Continue ReadingRewriting URL’s with Apaches .htaccess
Written on 10/09 • 0 Comments
This article looks at some common scenarios where a htaccess file can be used to manipulate a websites URL. Here we are going to look at how we can use htaccess to redirect our visitors to another location or accomplish some other common tasks.
Continue ReadingCentering Widthless Floats
Written on 09/25 • 0 Comments
This week I had a problem with centering a widthless floated element with CSS. It seemed an obvious thing to want to do but I could think of no simple solution, align center was not going to cut it here.
Continue ReadingMore articles can be found in the archives, feel free to have a look around and leave your comments.
Save a massive 40% on a subscription to .net magazine!
We love .net magazine (known as "Practical Web Design" outside the UK) and have teamed up with Future Publishing to get our readers up to a massive 40% off a years subscription.
Mint