Strange issue - all button text is right aligned

  • Thread starter Thread starter Ian
  • Start date Start date
I

Ian

All,

I have come across a strange issue with my ASP.NET application.

When I run my ASP.NET application all the text within the Button
controls are right aligned?

I suspect I must have unwittingly changed a property somewhere, is there
a global property for this?

TIA
Ian
 
I have come across a strange issue with my ASP.NET application.

When I run my ASP.NET application all the text within the Button controls
are right aligned?

I suspect I must have unwittingly changed a property somewhere, is there a
global property for this?

If you use the Firebug add-in for Firefox, you can right-click an element
and choose "Inspect Element" and it will show you the CSS used to style the
element. From that, it should be easy to find where the alignment is being
set.

(You could achieve the same in IE8 by pressing F12 to get the Developer
Tools window and drilling-down.)

HTH,

Andrew
 
All,

I have come across a strange issue with my ASP.NET application.

When I run my ASP.NET application all the text within the Button
controls are right aligned?

I suspect I must have unwittingly changed a property somewhere, is there
a global property for this?

TIA
Ian

Check if you have no CSS for input controls. e.g.

input {
text-align:right;
}

Check what culture is currently selected
 
Andrew said:
If you use the Firebug add-in for Firefox, you can right-click an
element and choose "Inspect Element" and it will show you the CSS used
to style the element. From that, it should be easy to find where the
alignment is being set.

(You could achieve the same in IE8 by pressing F12 to get the Developer
Tools window and drilling-down.)

HTH,

Andrew

After further investigation this only happens within IE8, Firefox the
displays the buttons with the text aligned, IE8 displays the buttons
right aligned.

After inspecting the object reveals the following :

element.style {
height:28px;
left:0;
position:absolute;
right:734px;
top:5px;
width:42px;
}
Inherited frombody
html, body {
text-align:center;
}
Default.aspx (line 8)
Inherited fromhtml
html, body {
text-align:center;
}

Any ideas?
 
After further investigation this only happens within IE8, Firefox the
displays the buttons with the text aligned, IE8 displays the buttons right
aligned.

Is it in all IE8s or just the one on your computer? You haven't accidentally
gone Page menu->Encoding->Right-To-Left Document, have you?(Although I'd
expect other "anomalies" to show in that case.)

If it's all IE8s, it might be worth checking how Opera renders it too. Did
you try pressing F12 in IE8?

Andrew
 
Andrew said:
Is it in all IE8s or just the one on your computer? You haven't
accidentally gone Page menu->Encoding->Right-To-Left Document, have
you?(Although I'd expect other "anomalies" to show in that case.)

If it's all IE8s, it might be worth checking how Opera renders it too.
Did you try pressing F12 in IE8?

Andrew
Checked the Encoding method and the page is set to Left-To-Right.

Within Opera the page renders perfectly.

Yes, pressed F12 within IE8 to produce the Developer Tools, for 1 of the
buttons it returns :

<INPUT style="POSITION: absolute; WIDTH: 42px; HEIGHT: 28px; TOP: 5px;
RIGHT: 734px; LEFT: 0px" id=ButtonSave value=Save type=submit
name=ButtonSave>
 
Yes, pressed F12 within IE8 to produce the Developer Tools, for 1 of the
buttons it returns :

<INPUT style="POSITION: absolute; WIDTH: 42px; HEIGHT: 28px; TOP: 5px;
RIGHT: 734px; LEFT: 0px" id=ButtonSave value=Save type=submit
name=ButtonSave>

There should be another pane showing you the inherited style.

Umm... the values should have quotes around them, e.g. type="submit".

Have you used a correct doctype declaration and validated the HTML and CSS
as Mark suggested?
http://validator.w3.org/

Andrew
 
Back
Top