Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Strange issue - all button text is right aligned

Reply
Thread Tools

Strange issue - all button text is right aligned

 
 
Ian
Guest
Posts: n/a
 
      01-07-2010
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
 
Reply With Quote
 
 
 
 
Andrew Morton
Guest
Posts: n/a
 
      01-07-2010
"Ian" wrote
>
> 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

 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      01-07-2010
On Jan 7, 10:31*am, Ian <(E-Mail Removed)> wrote:
> 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
 
Reply With Quote
 
Ian
Guest
Posts: n/a
 
      01-07-2010
Andrew Morton wrote:
> 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
Inherited fromhtml
html, body {
text-align:center;
}

Any ideas?
 
Reply With Quote
 
Andrew Morton
Guest
Posts: n/a
 
      01-07-2010
"Ian" wrote
> 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

 
Reply With Quote
 
Ian
Guest
Posts: n/a
 
      01-07-2010
Andrew Morton wrote:
> "Ian" wrote
>> 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

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>
 
Reply With Quote
 
Andrew Morton
Guest
Posts: n/a
 
      01-07-2010
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Menu Items is not right aligned with Right to Left documen =?Utf-8?B?QmlzaG95?= ASP .Net 0 12-28-2006 11:39 AM
left-right-center aligned mre HTML 2 03-10-2005 07:21 PM
Text is not aligned with the Radio Button BenJ ASP .Net Web Controls 0 01-13-2005 08:53 PM
Text is not aligned with the Radio Button BenJ ASP .Net Building Controls 0 01-13-2005 08:52 PM
right-aligned img in a div Nick Howes HTML 6 10-16-2003 09:28 PM



Advertisments