Snippets

Here's some of my tips, tweaks and tuts, ranging from PHP, Linux, MySQL and more!

Snippets / CSS

@font-face Firefox Cross Domain Problem

The other day I encountered a problem when using custom web fonts for use on a project.

I had my project content on mydomain.co.uk, I also had my images on a seperate subdomain - images.mydomain.co.uk and finally I had my fonts on another subdomain fonts.mydomain.co.uk.

My Problem with Firefox

I then tried to use these web fonts I had uploaded. I found out that this worked in all browsers (Chrome, IE, Opera) apart from Firefox & Safari.

After some research I found out that the Firefox browser restricts cross domain lookups for these files.

The .htaccess Fix

By allowing these cross domain lookups it will allow Firefox to correctly render my selected text with my preferred custom font. So inside mydomain.co.uk's root folder I update my .htaccess file.

# .htaccess file - allow access
header add Access-Control-Allow-Origin "mydomain.co.uk"

12 years ago / Read More

Snippets / CSS

Remove iPhone form input border

  • Difficulty: Easy
  • Snippet Length: 1 minute
  • Knowledge Needed: HTML, CSS

By default the iPhone browser adds an outline to any input boxes that have had their border or background colours removed through css.

If you wish to just strip this you can use the following webkit declaration

input { -webkit-appearance: none; }

13 years ago / Read More

Snippets / CSS

Multi-Browser Friendly

Now I can confirm that after a couple of weeks of testing the site runs smoothly in the majority of the most popular browers.

On the homepage the jQuery work slider has met some compatability problems however these have now been rectified and again the dreaded IE6 being the culprit.

The following Browsers have now been tested and have no issues;

  • Mozilla Firefox
  • Safari
  • Opera
  • Google Chrome
  • IE 9 Beta
  • IE 8, 7, 6
  • Android Supported
  • iPhone Supported

If anybody finds any problems please do not hesitate to contact me and let me know what platform and browser your using so I can fix it!

13 years ago / Read More