Firefox and "inline-block" support

This may be old news for some, but Firefox v2.0 does not support the display style "inline-block". I've read several blogs and articles on the subject, most of them suggesting using "-moz-inline-block" or "-moz-inline-stack" or "-moz-inline-box", none of which worked (and also managed to break IE support, subsequently).

Since I tend to fix my own problems (and quickly forget the solution when it creeps up again), I usually post a blog about it to remind myself in the future. In the event this blog helps anyone else out there, then gravy.

Turns out, "inline" works just fine and dandy. I should clarify a bit about the specific nature of my implementation. As the website I am working on is still written in ASP.NET 1.1, I can't use the cool new AJAX functionality. As a result, I've been forced into mixing ASP.NET and HTML controls on my pages, and accessing them through JavaScript.

I essentially wanted a checkbox that, when toggled, would hide and/or display a set of address controls.
The code looks like this:

function USHORAddress()
    if (Form1.chkUSHORAddress.checked)
        {
            document.getElementById(" <%= lblHORCity.ClientID %>l").style.display = "inline";
            //document.getElementById(" <%= lblHORCity.ClientID %>").style.display = "-moz-inline-block";
            //document.getElementById(" <%= lblHORCity.ClientID %>").style.display = "-moz-inline-stack";
            //document.getElementById(" <%= lblHORCity.ClientID %>").style.display = "-moz-inline-box";
        }
    else
        {
            document.getElementById(" <%= lblHORCity.ClientID %>").style.display = "none";
        }
}

Let me know if this helps anyone!

Doug

This article is part of the GWB Archives. Original Author: Doug Butscher

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.