Strange issue - all button text is right aligned

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
 
A

Andrew Morton

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
 
G

Guest

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
 
I

Ian

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?
 
A

Andrew Morton

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
 
I

Ian

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>
 
A

Andrew Morton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top