Code Chat

CSS Tips and Tricks

CSS specificity and point scoring

We all know about how CSS works right? Styles are inherited and cascade through the DOM to child elements. We know that CSS rules referring to element IDs have a greater weight than classes and inline styles trump them again. But how exactly does the browser work out which styles…
In: Code Chat
Wordpress

WordPress Optimisation Checklist

WordPress is a framework which is great for rapid development because it is so quick and easy to set up. Check out the famous WordPress 5 minute install. However, if you want to really make sure that your installation is working as efficiently and securely as possible, there are a…
In: Code Chat WordPress
mobile-devices

Custom Styles for Select Inputs

It’s long been a problem for developers that the Select (or dropdown) input doesn’t allow you many options for customising their look and feel. You shouldn’t be trying to style selects! When you search for help on this matter, you often come across people arguing that select inputs get their…
In: Code Chat JavaScript
failwhale

Twitter Changes Its Terms

In March 2011 Twitter announced some upcoming changes to its Terms of Use which would affect developers. This is really an understatement as what they’ve actually done is fundamentally redefined how they would like their service to be used and what developers ought to be using it for. What’s new?…
In: Code Chat

Preventing Contact Form Spam

This is a problem which comes up time and time again. Every time you add a contact form to a website, you open yourself up to spam attacks. Solving this problem involves striking the right balance between making life easy for the person filling in the form, and the person…
In: Code Chat

Target _blank is out the window

Clients will often ask me to target external site links to open in a new window. Of course the correct answer is “No, it’s not up to a site to determine how a link should work, the user can decide that when browsing.” Not only is it bad practice but…
In: Code Chat JavaScript
YouTube Developers

YouTube Data Class

This is a class I’ve used several times and it demonstrates some of the useful data endpoints offered by YouTube. Often I will have to ask users or a web service for YouTube videos, and these may come in the form of share URLs, embed code or video URLs. This…
In: Code Chat PHP

Captionator using JQuery

A nice effect is to have the caption for a text field within the field instead of having a separate label. However it can be frustrating for a user if they have to delete the text before they can type into it. This JavaScript class looks for texfields with a…
In: Code Chat
Union Flag

CSS Triangles

Creating triangles using css alone
In: Code Chat
Facebook Developers

Thumbnails for sharing with Facebook

Facebook’s integration which allows you to post a page to Facebook is really clever. A bit too clever in fact. The integration allows you to pass the url and title though to the sharing window. The sharing window then goes and take s a look at the page and selects…
In: Code Chat