Strange issue - all button text is right aligned

Discussion in 'ASP .Net' started by Ian, Jan 7, 2010.

  1. Ian

    Ian 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
    Ian, Jan 7, 2010
    #1
    1. Advertising

  2. "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
    Andrew Morton, Jan 7, 2010
    #2
    1. Advertising

  3. On Jan 7, 10:31 am, Ian <> 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
    Alexey Smirnov, Jan 7, 2010
    #3
  4. Ian

    Ian Guest

    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 8)
    Inherited fromhtml
    html, body {
    text-align:center;
    }

    Any ideas?
    Ian, Jan 7, 2010
    #4
  5. "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
    Andrew Morton, Jan 7, 2010
    #5
  6. Ian

    Ian Guest

    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>
    Ian, Jan 7, 2010
    #6
  7. > 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
    Andrew Morton, Jan 7, 2010
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nick Howes

    right-aligned img in a div

    Nick Howes, Oct 13, 2003, in forum: HTML
    Replies:
    6
    Views:
    444
    David Dorward
    Oct 16, 2003
  2. mre
    Replies:
    2
    Views:
    432
  3. =?Utf-8?B?QmlzaG95?=
    Replies:
    0
    Views:
    967
    =?Utf-8?B?QmlzaG95?=
    Dec 28, 2006
  4. BenJ

    Text is not aligned with the Radio Button

    BenJ, Jan 13, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    186
  5. BenJ

    Text is not aligned with the Radio Button

    BenJ, Jan 13, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    158
Loading...

Share This Page