Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

div tag not centering in firefox

Posted on 2007-11-22
4
Medium Priority
?
772 Views
Last Modified: 2008-02-01
I have a div tag that is set to center my log in control and it works in IE, but left aligns in firefox:

    <div style="text-align: center">

How do I get that panel to center in firefox too?

thanks!
0
Comment
Question by:Starr Duskk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 20

Accepted Solution

by:
dsacker earned 2000 total points
ID: 20337473
Use ...

    <div align="center">

This will center in all browsers.
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 20337484
sure enough. thanks!
0
 
LVL 1

Expert Comment

by:edenmachine
ID: 20337501
Alternatively you can just make the div 100% in width so that the text can center inside of it:

<div style="text-align: center; width:100%;">
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20337608
You should use style.  The align attribute is deprecated.  However depending on what your "log in control" is the text-align: center style may not work; it is just for text.  An alternative is to make the div the size of the control and then use margin.  This will actually center the div itself in the page, not just the contents.  For example ...

<div style="width: 150px; margin: 0 auto;">

The key to the centering is the limited size (i.e. not 100% and the auto for the left and right side of the margin.

bol
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question