Tag: Internet Explorer

IE6 Empty Div spacing issue

It has become fairly common practice to use CSS to fill the contents of an empty DIV tag. For example, I’m working on a project now that uses the following DIV:

<div id="main_nav_top_shadow"></div>

And with CSS I’m giving that div a fixed height and a repeating background image that creates the appearance of a shadow being cast upward on top of my main nav.

#main_nav_top_shadow {
height: 6px;
background-image: url(../images/main_nav_top_shadow_x.gif);
background-repeat: repeat-x;
}

The problem is that IE6 thinks that the empty space consists of text. Empty text, but text nonetheless. So what happens is that whatever the default font size for that particular DIV becomes the height of the DIV, rather than my specified height: 6px; in the CSS. There are 2 fixes for this problem, one of which I’ve been using forever and another I just stumbled upon and which prompted me posting both solutions. Both are fairly easy.

Solution #1
This solution is the one I’ve been using forever. Basically, you just choose a font size that’s smaller than the height you are setting.

#main_nav_top_shadow {
height: 6px;
font-size: 1px;
background-image: url(../images/main_nav_top_shadow_x.gif);
background-repeat: repeat-x;
}

That usually does the trick. But this has always seemed wrong. I can’t say why, it just feels weird. Maybe it’s the fact that I’m setting a font size for no text at all.

Solution #2
This solution I found this week and actually makes more sense to me. It involves using simple HTML comments. And not the [if IE] stuff either. Just a plain simple comment:

<div id="main_nav_top_shadow"><!--Leave this empty--></div>

It does not matter what text you put in there. It’s not any command to the browser or anything. But it works, by darn! I guess IE6 feels more comfortable not having anything in that div, as long as you put a comment there.

Not only does that work, but it is the right thing to do. After all, the next guy to come along and read your code might see an empty DIV and be tempted to remove it because it contains no content. This way you can leave some nice little message pleading the proverbial programmer to leave well enough alone!

Bookmark and Share

9 Responses  |  add yours »

Windows Mobile file Explorer hijacked

My company has been promising me a web enabled Palm Treo for some time now, and finally that happened last Friday. I got a Palm Treo 700wx with Windows Mobile. I’ve been spending a lot of time getting it up and running, installing apps and synchronizing all of my stuff.

The stuff of which I speak includes my favorites. Which consists of an export of my Firefox bookmarks, imported into IE, and then sync-ed into mobile IE.

One of my tricks in Firefox is a bookmark to Gmail without any text as the name of the link so that the favicon itself is the only visible que, and it acts as a simple quick link to my most frequently visited site. It was this shortcut that caused me a lot of grief and at least 4 hard resets to remedy.

The issue was that whenever I went to the “My Device” directory in my file explorer, it would’nt open a directory listing but rather my browser and into Gmail. It seemed as though Internet Explorer had hijacked my file explorer!

Well, apparently a favorite without text does just that in Windows Mobile (version 5 in my case).

For me this was an unfavorable and difficult to diagnose circumstance, but maybe you can use this as some sort of Windows Mobile hack.

Bookmark and Share

No Response  |  add yours »

How to download Super from erightsoft

(NOTE: Since this post was first written, I have since abandoned Super for the far superior Movavi Video Converter which will do everything Super does, but is much easier to use and obviously much easier to download. It even rips DVDs which Super cannot do. It’s not free like Super, but it’s well worth the cheap $30. Trust me on this one!)

Ever get stuck in an endless loop, trying to download video converter, Super? Here’s how to break the loop.

I’ve never once been able to download it using Firefox, so if I were you I wouldn’t even bother trying.

Basically, you need to add the download site to your trusted sites in IE. But wait! I said the download site. Although it may appear that you are downloading directly from the www.erightsoft.com domain, you will actually be downloading from gpl.download.free.fr/Super.html so go ahead and point your browser there now.

Once you are on the right domain, open up your internet options and click the ’security’ tab. Then hit the ‘trusted sites’ icon and add the current domain (be sure to un-check the option that requires it to be an https site). Now that gpl.download.free.fr has been added to your trusted sites list, change your trusted sites level to ‘Low.’

Now all you need to do is scroll to the bottom of the page and click ‘Start Downloading SUPER’ which will take you to http://gpl.download.free.fr/Superdc.html where you will see a link that says ‘download and use’ near the top of the screen. Click that and it will take you to http://gpl.download.free.fr/S6Kg1.html where you will see the download links at the bottom of the screen. Why didn’t I have you go there to begin with instead of clicking all these links? Well, the good people of erightsoft (or whoever they are) don’t want you to download Super from anywhere but on their site, so they check the referrer of how you got to the download page and if you don’t get there in the order I described above, you will be redirected to the begining and have to start all over.

Happy video converting!

Bookmark and Share

70 Responses  |  add yours »

Embedding Multimedia Objects While Supporting Standards

In December I posted an entry called Embedding Flash While Supporting Standards as an improved suggestion over the Flash Satay Method. I’ve recently been playing with objects such as Windows Media and Quick Time where the Satay Method doesn’t even begin to work. As it turns out the Gillay method works for all types of objects (and allow me to re-emphasize that it works without javascript).

Before I get too far, let me show an updated example of the Gillay method. This example will appear slightly different than the examples in my other post but reflects further discussion that took place within the comments section of that post.

<!–[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase=
"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab
#version=7,0,19,0" width="780" height="590" id="gilluminate">
<param name="movie" value="gilluminate.swf" />
<![endif]x–>
<!–[if !IE]> <–>
<object type="application/x-shockwave-flash" data="gilluminate.swf" width="780" height="590" name="gilluminate">
<!–> <![endif]–>
<param name="movie" value="gilluminate.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#2C676C" />
<p>gilluminate is mostly a showcase of things I have done, things I am doing, and things I can do. It is powered by a combination of HTML, Flash, ActionScript, XML, JavaScript, CSS and PHP and displays my recent websites and artwork.<br />You need the latest free <a href="http://www.macromedia.com/shockwave/download/download.cgi?
P1_Prod_Version=ShockwaveFlash">Flash Player Plugin</a> to view this site.</p>
</object>

Basically what is happening here is that I’m hiding the IE friendly object tag from every browser that’s not IE, and vice versa.

This same principal can be applied when "embedding" Windows Media or Quick Time movies, and probably every other type of object. Here’s an example of using the Gillay method with Quick Time:

<!–[if IE]><object classid=
"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="250" height="140" codebase="http://www.apple.com/qtactivex/qtplugin.cab
#version=6,0,2,0" standby="Loading Quick Time components…"><![endif]x–>
<!–[if !IE]> <–>
<object type="video/quicktime" data="example.mov" width="$width" height="$height" standby="Loading Quick Time components…">
<!–> <![endif]–>
<param name="controller" value="true" />
<param name="type" value="video/quicktime" />
<param name="autoplay" value="true" />
<param name="scale" value="aspect" />
<param name="BGCOLOR" value="#000000" />
<param name="target" value="myself" />
<param name="src" value="example.mov" />
<param name="pluginspage" value="http://www.apple.com/quicktime/download/" />
<a href="http://www.apple.com/quicktime/download/">Quick Time Player</a> required or <a href="#" onclick="window.close();">close this window</a> and select a different format.
</object>

This code will play the example.mov movie in Firefox, IE, Safari, and IE for Mac and will validate on the W3C website

Bookmark and Share

1 Response  |  add yours »

Scrolling in Internet explorer causes elements to lose focus

Today I spent a few hours trying to debug a web app which uses an autosuggest similar to Google Suggest. I also had an “onBlur” on the text box that will hide the suggestions. Unlike Google Suggest, I could not limit the number of suggestions because it was suggesting names of people in the database and I can’t just list the first 10 or 15 “Johnson” names, I have to list them all. That “Johnson” list can get long enough to overflow off the page, causing a need to scroll down to see all results listed.

Although this wasn’t a problem in Firefox, Internet Explorer was causing the text box to lose focus and therefore hide suggestions whenever I clicked the scroll bar in order to view lower results. I tried Google’s page and shrunk my window enough that a scroll bar appeared, but Google’s suggestions weren’t dissapearing! What in the world is going on here? After searching through my code for something I might be doing that would cause it, I finally started just simply deleting elements from my page until it worked. It wasn’t until I deleted the Doc Type Declaration at the top of the page that it started working. I checked Google Suggest’s code, and sure enough, there is no DTD on that page.

Bookmark and Share

2 Responses  |  add yours »

Search