Aligning text

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,
 
G

Guest

“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.
 
G

Guest

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top