Archive

Posts Tagged ‘IE’

Resetting CSS default padding and margins

April 8th, 2009 ben No comments

I’ve started work on a new site this week and one of the things I stumbled upon was a nifty method for reseting the default values of potentially any CSS property. This is especially useful because each browser has different ‘default’ settings (such as padding and margins).

In extreme cases browsers will position HTML elements using different CSS properties, for example IE uses margin-left to indent lists, while firefox (or rather its engine) uses padding-left. This code:

* {
padding:0;
margin:0;
}

will reset all spacing default properties. Excellent! However now we have to manually set all the margins and padding of our ‘H1->Hx’ elements, a potentially lengthy process. However we can rectify this by assigning several elements properties in one go.


h1, h2, h3, body {
margin: 10px;
padding: 10px;
}

Obviously these are only simple examples, but this is one technique I will be using in all of my websites from now on… if you are interested in further reading, this is an invaluable link ‘Eric Meyers, CSS Legend‘.

FavIcons and the Apache Error Log, damn you IE!

March 30th, 2009 ben No comments

Having written a small post about favicons, I stumbled across some interesting information while looking through works apache error log. Besides being HUGE, it was also annoyingly filled with favicon.ico missing statements.

This wouldn’t be such a big problem, if it wasn’t for the fact that I have never referenced a file called favicon.ico (for that matter my favicon are .PNGs). It turns out that IE5 by default looks for ‘favicon.ico’ in sites root directory, regardless of whether you specified a meta location or not (see the post below).

The solution?…. Nothing elegant I am afraid. Your chooses:

  1. Place the ‘favicon.ico’ in your sites root directory
  2. Inform apache that the file isn’t their and too not even bother looking (http://www.trilithium.com/johan/2005/02/no-favicon/)
  3. Create a dummy favicon.ico and place it in the root directory

I hate IE…

Categories: HTML, images Tags: , ,