Alignment issues in Firefox, but not in Chrome or Opera

Hi there,
The code below properly displayed in Chrome and Opera.  But, not in Firefox.  How can I fix it?


var createGUI = function() {
        var containerDiv = document.createElement("div");
        containerDiv.id = "ID1";

        var fieldSet1 = document.createElement("fieldset");
        var legend1 = document.createElement("legend");
        legend1.innerHTML = "Type";
        fieldSet1.appendChild(legend1);

        var innerContainerDiv = document.createElement("div");
        innerContainerDiv.style.padding = "15px";
        innerContainerDiv.style.display = "-webkit-box";

        var typeSelectorDiv = document.createElement("div");
        var typeSelector = document.createElement("select");
        typeSelector.id = "TypeSelectorID";

        var option1 = document.createElement("option");
        option1.text = "Option1";

        var option2 = document.createElement("option");
        option2.text = "Option2";

        var option3 = document.createElement("option");
        option3.text = "Option3";


        typeSelector.appendChild(option1);
        typeSelector.appendChild(option2);
        typeSelector.appendChild(option3);

        typeSelectorDiv.appendChild(typeSelector);


        var radioDiv = document.createElement("div");
        radioDiv.id = "RadioDivID";

        var radio1 = document.createElement("input");
        radio1.style.paddingRight = "5px";
        radio1.setAttribute("type", "radio");
        radio1.setAttribute("name", "SelectorName");
        radio1.setAttribute("id", "SelectorID1");
        radioDiv.appendChild(radio1);

        var radio1Label = document.createElement("label");
        radio1Label.innerHTML = "Radio1";
        radio1Label.style.paddingRight = "20px";
        radioDiv.appendChild(radio1Label);

        var radio2 = document.createElement("input");
        radio2.style.paddingRight = "5px";
        radio2.setAttribute("type", "radio");
        radio2.setAttribute("name", "SelectorName");
        radio2.setAttribute("id", "SelectorID2");
        radioDiv.appendChild(radio2);
        radioDiv.style.display = "-webkit-box";
        var radio2Label = document.createElement("label");
        radio2Label.innerHTML = "Radio2";
        radio2Label.style.paddingRight = "20px";
        radioDiv.appendChild(radio2Label);

        var radio3 = document.createElement("input");
        radio3.style.paddingRight = "5px";
        radio3.setAttribute("type", "radio");
        radio3.setAttribute("name", "SelectorName");
        radio3.setAttribute("id", "SelectorID3");
        radioDiv.appendChild(radio3);
        var radio3Label = document.createElement("label");
        radio3Label.innerHTML = "Radio3";
        radioDiv.appendChild(radio3Label);

        typeSelectorDiv.style.paddingRight = "30px";

        innerContainerDiv.appendChild(typeSelectorDiv);
        innerContainerDiv.appendChild(radioDiv);
        fieldSet1.appendChild(innerContainerDiv);

        containerDiv.style.paddingBottom = "15px";
        containerDiv.appendChild(fieldSet1);

        return containerDiv;
    };

   document.getElementById("TestID").appendChild(createGUI());

Open in new window

ambuliAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ambuliAuthor Commented:
Julian HansenCommented:
You are using display: -webkit-box - which will only work in webkit browsers.

What you want is
display: -moz-box;
display: -webkit-box;
display: flex;

I would give your div a class and then put the above in the styles sheet for that class.
.myBoxClass {
  display: -moz-box;
  display: -webkit-box;
  display: flex;
}

Open in new window

Then instead of  
  innerContainerDiv.style.display = "-webkit-box";

Open in new window

I would put
  innerContainerDiv.className = 'myBoxClass';

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
Or you could do this
  innerContainerDiv.style.display = "flex";

Open in new window

Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

ambuliAuthor Commented:
Excellent!  Thanks very much!
ConyersITCommented:
It is also good practice to use a CSS reset before you start your own css. This gives a solid baseline when working across multiple browsers.
Julian HansenCommented:
You are welcome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.