Link to home
Start Free TrialLog in
Avatar of Rave_Technologies
Rave_Technologies

asked on

How do I get text-align:center when using min-width property on input button in firefox

Hello Everyone,
                         I am new to Experts site. I am facing one problem in css.
Requirement: text should be centered on buttons and button will have minimum width.
Status:  Working fine in IE but not not in Firefox.
Please see the below code which I used for button
  Can any one suggest the css code which works in firefox
.button
{
	width: auto !important;
	min-width: 20mm;
	width: 20mm;
	height: 6mm;
	text-align: center;
	text-align: -moz-center;
	overflow: visible;
	padding: 0em 2mm 0em 2mm;
	margin: 0em 0em 0em 0em;
	color: #330066;
	font-weight: bold;
	font-size: 0.8em;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	vertical-align: top;
	font-size: 100%;
}

Open in new window

Avatar of flob9
flob9
Flag of France image

Working for me in firefox.

Can you show us the entire page ?
Give it this way
.button
{
         width: auto !important;
        min-width: 20mm;
        width: 20mm;
        text-align: center;
        text-align: -moz-center;
        overflow: visible;
        padding: 0em 2mm 0em 2mm;
        margin: 0em 0em 0em 0em;
        color: #330066;
        font-weight: bold;
        font-size: 0.8em;
        font-family: Verdana, Arial, Helvetica, sans-serif;
        vertical-align: top;
        font-size: 100%;
}
I think you're talking about how it doesn't vertical align to the center.  It looks like your problem is that your height is too small for your font size, if you increase the height to 10mm or more it centers vertically in firefox and IE.
Avatar of Rave_Technologies
Rave_Technologies

ASKER

Hello Friends,
                      I dont no how to reply to ur answers. putting all answers in single comment.

1. Working for me in firefox.
     Can you show us the entire page ?
A)  Please check text having Single  chanracter (eg L). with large data working fine in firefox
2.)Give it this way
    minimum height is required.
3)  i am talking about horizontally center alignment

  Please any one suggest
I works for me with single caracter :

<button class="button">a</button>  

how are you using it ?
hi,
    I am using like this.
  <input type="button" value="L" class="button"/>

     This code (<button class="button">a</button>  ) I never seen. which language is this?
Hello Friend,

                 You are right? working properly in Firefox 3.0 but I want to work in Firefox 1.5.
We are building an application in multilingual which need to support in 12 combinations of OS and browsers.
So we need to take care of all browsers

thanks for your patience.
Please provide any alternative if you know
button is an html tag equivalent to input type button.

I don't have firefox 1.5 installed, but maybe you can try to use it instead of <input> tag.
Note you can include html in a <button>; this could be a workaround for your problem.
Hello Friend,

              I have tried with your code also in FF1.5 and FF2.0. Eventhough it not working.
Just it working in FF 3.0.

Can u tell me any alternative to get the solution. bcz the deadline of CR (For button) is approaching
ASKER CERTIFIED SOLUTION
Avatar of flob9
flob9
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello Friend,

                    The solution is working fine in FF 1.5. But i have to see how I can implemnet in aspx code.
I mean <asp:button> control.

I am happy with this solution.
Thx for it.
Avatar of Gary
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.