Left Align Text In Server Button

Discussion in 'ASP .Net' started by DM, Jan 31, 2004.

  1. DM

    DM Guest

    Is there any way to left align the text in a server control button?
     
    DM, Jan 31, 2004
    #1
    1. Advertising

  2. DM

    Jos Guest

    DM wrote:
    > Is there any way to left align the text in a server control button?


    style="width:200px;text-align:left"

    --

    Jos Branders
     
    Jos, Jan 31, 2004
    #2
    1. Advertising

  3. DM

    Nakul Guest

    Hi,

    Try this

    <asp:Button id="Button1" runat="server" Text="Button" Width="256px"
    style="TEXT-ALIGN: left"></asp:Button>

    This align the text left for the button

    Thanks
    Nakul



    "DM" <> wrote in message
    news:...
    > Is there any way to left align the text in a server control button?
    >
    >
     
    Nakul, Feb 1, 2004
    #3
  4. Anybody know how to do this "in the code behind the form"? We have a class defined to handle button mouseover behaviour and the like. We would like the ability to add the text alignment to the form. While editing the HTML does work, it would be easier if we did not have to edit every single button on the web page

    Thanks

    Timothy Swanso
    ----- Nakul wrote: ----

    Hi

    Try thi

    <asp:Button id="Button1" runat="server" Text="Button" Width="256px
    style="TEXT-ALIGN: left"></asp:Button

    This align the text left for the butto

    Thank
    Naku



    "DM" <> wrote in messag
    news:..
    > Is there any way to left align the text in a server control button
    >>
     
    =?Utf-8?B?dHN3YW5zb24=?=, Feb 18, 2004
    #4
  5. Hi, Timothy Swanson,

    You can create a style and then assign it to the buttons. something like
    this:

    <style type="text/css">
    ..leftAlign
    {
    text-align: left;
    }
    </style>

    then assign it:

    button1.CssClass = "leftAlign";
    button2.CssClass = "leftAlign";
    etc.

    Documentation:
    http://msdn.microsoft.com/library/e...uiwebcontrolswebcontrolclasscssclasstopic.asp

    Hope this helps
    Martin
    "tswanson" <> wrote in message
    news:...
    >
    > Anybody know how to do this "in the code behind the form"? We have a

    class defined to handle button mouseover behaviour and the like. We would
    like the ability to add the text alignment to the form. While editing the
    HTML does work, it would be easier if we did not have to edit every single
    button on the web page.
    >
    > Thanks,
    >
    > Timothy Swanson
    > ----- Nakul wrote: -----
    >
    > Hi,
    >
    > Try this
    >
    > <asp:Button id="Button1" runat="server" Text="Button" Width="256px"
    > style="TEXT-ALIGN: left"></asp:Button>
    >
    > This align the text left for the button
    >
    > Thanks
    > Nakul
    >
    >
    >
    > "DM" <> wrote in message
    > news:...
    > > Is there any way to left align the text in a server control button?
    > >>
     
    Martin Dechev, Feb 18, 2004
    #5
  6. Thanks Martin

    That is getting closer, but it still involves editing the HTML code
    I have tried making definitions in Styles.css and they are all ignored

    Are there any other ideas, or should I stick with what works

    Thanks again
    ----- Martin Dechev wrote: ----

    Hi, Timothy Swanson

    You can create a style and then assign it to the buttons. something lik
    this

    <style type="text/css"
    ..leftAlig

    text-align: left

    </style

    then assign it

    button1.CssClass = "leftAlign"
    button2.CssClass = "leftAlign"
    etc

    Documentation
    http://msdn.microsoft.com/library/e...buiwebcontrolswebcontrolclasscssclasstopic.as

    Hope this help
    Marti
    "tswanson" <> wrote in messag
    news:..
    >> Anybody know how to do this "in the code behind the form"? We have

    class defined to handle button mouseover behaviour and the like. We woul
    like the ability to add the text alignment to the form. While editing th
    HTML does work, it would be easier if we did not have to edit every singl
    button on the web page
    >> Thanks
    >> Timothy Swanso

    > ----- Nakul wrote: ----
    >> Hi
    >> Try thi
    >><asp:Button id="Button1" runat="server" Text="Button" Width="256px

    > style="TEXT-ALIGN: left"></asp:Button>>> This align the text left for the butto
    >> Thank

    > Naku
    >>>> "DM" <> wrote in messag

    > news:..
    >> Is there any way to left align the text in a server control button
    >>>
     
    =?Utf-8?B?dHN3YW5zb24=?=, Feb 19, 2004
    #6
  7. "=?Utf-8?B?dHN3YW5zb24=?=" <> wrote in
    news::
    > That is getting closer, but it still involves editing the HTML code.
    > I have tried making definitions in Styles.css and they are all ignored.
    >
    > Are there any other ideas, or should I stick with what works?


    Validate your CSS. When CSS is bad, you dont get errors. It just doesnt work.


    --
    Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
    "Programming is an art form that fights back"
     
    Chad Z. Hower aka Kudzu, Feb 19, 2004
    #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. Kay
    Replies:
    2
    Views:
    7,189
  2. Paul Lautman

    left align within centre align

    Paul Lautman, Mar 3, 2006, in forum: HTML
    Replies:
    3
    Views:
    582
    Paul Lautman
    Mar 3, 2006
  3. =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

    Help on table align on left of page vs left hanging indent

    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=, Jul 10, 2007, in forum: XML
    Replies:
    2
    Views:
    1,021
    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=
    Jul 16, 2007
  4. boy0612

    How to set button text Align to left?

    boy0612, Jul 28, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    162
  5. boy0612

    How to set button.text Align to left?

    boy0612, Jul 28, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    179
Loading...

Share This Page