Aligning text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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,
 
“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.
 
Thanks Phillip.
--
Joe


Phillip Williams said:
“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
 
Back
Top