Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I opened up my project.. and I saw a Styles.css.. I assume that all asp.net/vb.net projects have the styles.css in them as default?

 

And the style sheets are already utilized?

Posted

Nm.. got it.. very easy..

Just drag 'styles.css" to the aspx project..and then styles.css is enabled :)

 

But.. How do I center the label txt using stylesheets?

Posted

Google CSS .... for future ref.

 

To answer your question. Give yourself a class in the style sheet for the things you want to have center aligned. Then in that class use the text-align property and set it to center:

 

.centerText

{

text-align: center;

}

 

Again, Google CSS, it will help.

Posted

Actually.. my problem was something I wasn't explaining right.. the label was 300px wide.. and i wanted the txt inside the label to be centered.

 

So what i did was just set the label to nothing px wide.

 

then centered it. (with css or <center></center>)

Posted

Also.. I still don't know how to apply .centerText to just this:

 

<P><asp:label id="errormsg" runat="server" Height="32px" ForeColor="Red"></asp:label></P>

 

Ideas?

 

/ps.. using <center></center> results in this errror msg:

The World-Wide-Web Consortium now regards the element 'center' as outdated. Newer constructs are recommended.

Posted (edited)

I can center fields with CSS..

 

But I need to center the text inside a label field..

I cannot just center the label field (because it has to be justified right)

 

 

any ideas?

 

thanks

Lee

Edited by trend

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...