Microtricks

CSS hack to minimize position differences between Firefox, IE6 & IE7

Friday July 25th, 2008
 

Writting a good CSS can be annoying when we try to show the exact same page on Firefox, Internet Explorer 6 and Internet Explorer 7.

Each browser has a different way to parse the CSS code, showing sometimes little, and sometimes huge differences on the elements positions.

For example, the margin property doesn’t work the same on FF and IE7. The first applies the margin related to their parent elements, and IE7 related to the “same level” elements.

This little hack will allow us to write different attributes for each browser, or to show deliberated differences:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Firefox class */ 
.element { 
margin: 10px 10px 10px 10px; 
background-color: #f00; 
} 
 
/* IE7 Class */ 
*:first-child+html .element { 
margin: 5px 5px 5px 5px; 
background-color: #0f0; 
} 
 
/* IE6 Class */ 
* html .element { 
margin: 2px 2px 2px 2px; 
background-color: #00f; 
}

If we assign this class to an element, for example <div class=”element”>, each browser will take the one that fits to it, in this case, a red background for firefox, a green background for IE7 and a blue background for IE6. Each class has different margin values, correcting the position differences that could exist in the page distribution.

Installing Vista SP1 on Vaio TZ

Sunday July 20th, 2008
 

Service Pack 1 on Windows Vista is incompatible with certain versions of some drivers; that’s the reason because SP1 does not appear on windows update.

The conflict is with Mobile Intel 954GM Express driver: the last version supplied by Sony is 7.14.10.1380, and the not compatible versions are in the range of 7.14.10.1322 and 7.14.10.1403 (both included).

I have readed some people was trying to install the standalone SP1, but that’s a dirty solution, and it causes conflicts within the system, so I recommend to don’t try that.

The solution for the SP1 is kinda simple (tricky but simple), and I found that by chance. We will reinstall the actual graphic driver on the system to force windows update to offer us an optional update with a newer version of the driver (in my case the 7.14.10.1437, of course compatible with SP1).

  • First step: Updating graphic driver with the actual version on the system. 
  • Second step: Reboot the system and try a windows update. This time it should offer us an optional update with the Intel 945GM Express driver: Install it.
  • Third step: Reboot again, check the new driver version, and again, windows update. If all was ok we have now the option to install SP1.

I have to say that my Vaio model is the TZ32VN (Spain) with Vista Business. Perhaps that doesn’t work with other models. In that case, another option is to visit www.sony-drivers.com, and search for “7.14.10“, choosing the driver from another Vaio (not TZ necessarily) with a version major to 7.14.10.1403. That should work without problems, but I recommend to give a try  with the workaround of windows update first.

Vaio TZ con SP1