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"); = "ID1";

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

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

        var typeSelectorDiv = document.createElement("div");
        var typeSelector = document.createElement("select"); = "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";



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

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

        var radio1Label = document.createElement("label");
        radio1Label.innerHTML = "Radio1"; = "20px";

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

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

        fieldSet1.appendChild(innerContainerDiv); = "15px";

        return containerDiv;


Open in new window

Who is Participating?

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

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 = "-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 = "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!
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

From novice to tech pro — start learning today.