Aligning text

Discussion in 'ASP .Net' started by =?Utf-8?B?Sm9l?=, Jan 25, 2006.

  1. Hello All:

    Is it possible to align text (left, center, right) in a label, literal or
    literalcontrol? I haven't seen any examples and can't seem to work this one
    out (which means that it is probably straightforward ;)). I know I could use
    a CSSClass, but am wondering if there is something here that I have missed.

    TIA,
    --
    Joe
     
    =?Utf-8?B?Sm9l?=, Jan 25, 2006
    #1
    1. Advertising

  2. “The Literal control is similar to the Label control, except the Literal
    control does not allow you to apply a style to the displayed text. You can
    programmatically control the text displayed in the control by setting the
    Text property.â€
    http://msdn2.microsoft.com/en-us/library/f0aw4d5w(en-US,VS.80).aspx

    To align text in a label use cssClass (where the style attribute text-align
    is set to left, right, center, etc..). You would typically use the literal
    control if you need a placeholder (for the ASP.NET engine to use for
    rendering other controls) for controls to be added programmatically, in which
    case you can set their style individually.

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "Joe" wrote:

    > Hello All:
    >
    > Is it possible to align text (left, center, right) in a label, literal or
    > literalcontrol? I haven't seen any examples and can't seem to work this one
    > out (which means that it is probably straightforward ;)). I know I could use
    > a CSSClass, but am wondering if there is something here that I have missed.
    >
    > TIA,
    > --
    > Joe
     
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=, Jan 25, 2006
    #2
    1. Advertising

  3. Thanks Phillip.
    --
    Joe


    "Phillip Williams" wrote:

    > “The Literal control is similar to the Label control, except the Literal
    > control does not allow you to apply a style to the displayed text. You can
    > programmatically control the text displayed in the control by setting the
    > Text property.â€
    > http://msdn2.microsoft.com/en-us/library/f0aw4d5w(en-US,VS.80).aspx
    >
    > To align text in a label use cssClass (where the style attribute text-align
    > is set to left, right, center, etc..). You would typically use the literal
    > control if you need a placeholder (for the ASP.NET engine to use for
    > rendering other controls) for controls to be added programmatically, in which
    > case you can set their style individually.
    >
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "Joe" wrote:
    >
    > > Hello All:
    > >
    > > Is it possible to align text (left, center, right) in a label, literal or
    > > literalcontrol? I haven't seen any examples and can't seem to work this one
    > > out (which means that it is probably straightforward ;)). I know I could use
    > > a CSSClass, but am wondering if there is something here that I have missed.
    > >
    > > TIA,
    > > --
    > > Joe
     
    =?Utf-8?B?Sm9l?=, Jan 25, 2006
    #3
    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. Onur Bozkurt

    Re: aligning text in a asp label

    Onur Bozkurt, Jul 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    778
    Onur Bozkurt
    Jul 25, 2003
  2. Phillip
    Replies:
    2
    Views:
    3,228
  3. BGW
    Replies:
    3
    Views:
    454
  4. shank

    image and aligning text

    shank, Oct 3, 2003, in forum: HTML
    Replies:
    0
    Views:
    384
    shank
    Oct 3, 2003
  5. Steven Bethard

    aligning text with space-normalized text

    Steven Bethard, Jun 30, 2005, in forum: Python
    Replies:
    6
    Views:
    383
    Steven Bethard
    Jul 1, 2005
Loading...

Share This Page