Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > CSS substitution for the <center> tag

Reply
Thread Tools

CSS substitution for the <center> tag

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      01-16-2007
As most of us probably know, the <center> tag is deprecated. Because many
elements and controls have an align attribute, centering them is easy
enough. However, certain elements/controls do not (such as the ASP.NET
Button and Label controls). For the ASP.NET label control I usually just add
the following attributes:

Width="100%" style="text-align:center;"

However, this does not work for controls such as the ASP.NET Button control.
The only solution I can think of is to nest it inside of <div
align="center"></div> tags. However, this could add a lot of extra tags. Any
suggestions? Thanks.
--
Nathan Sokalski
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      01-16-2007
As I said in my original message, I have used that, but would like to have a
way that does not involve any extra tags (in other words, I would like to do
it using CSS). Any other ideas? Thanks.
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/

"Gaurav Vaish (MasterGaurav)" <(E-Mail Removed)> wrote
in message news:%(E-Mail Removed)...
> <div align='center'>
> </div>
>
>
> --
> Happy Hacking,
> Gaurav Vaish | www.mastergaurav.com
> www.edujini-labs.com
> http://eduzine.edujinionline.com
> -----------------------------------------
>
>
> "Nathan Sokalski" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> As most of us probably know, the <center> tag is deprecated. Because many
>> elements and controls have an align attribute, centering them is easy
>> enough. However, certain elements/controls do not (such as the ASP.NET
>> Button and Label controls). For the ASP.NET label control I usually just
>> add the following attributes:
>>
>> Width="100%" style="text-align:center;"
>>
>> However, this does not work for controls such as the ASP.NET Button
>> control. The only solution I can think of is to nest it inside of <div
>> align="center"></div> tags. However, this could add a lot of extra tags.
>> Any suggestions? Thanks.
>> --
>> Nathan Sokalski
>> (E-Mail Removed)
>> http://www.nathansokalski.com/
>>

>
>



 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      01-16-2007
Do you mean aligning the text inside a button? Aligning with
style="text-alignxx" does work for this.And the text is already centered
by default. Do you mean something else?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Nathan Sokalski" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> As most of us probably know, the <center> tag is deprecated. Because many
> elements and controls have an align attribute, centering them is easy
> enough. However, certain elements/controls do not (such as the ASP.NET
> Button and Label controls). For the ASP.NET label control I usually just
> add the following attributes:
>
> Width="100%" style="text-align:center;"
>
> However, this does not work for controls such as the ASP.NET Button
> control. The only solution I can think of is to nest it inside of <div
> align="center"></div> tags. However, this could add a lot of extra tags.
> Any suggestions? Thanks.
> --
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/
>



 
Reply With Quote
 
Nathan Sokalski
Guest
Posts: n/a
 
      01-16-2007
No, I am referring to horizontally centering the button on the page (or
within the div, td, or other tag that it is contained in). Thanks.
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/

"Eliyahu Goldin" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Do you mean aligning the text inside a button? Aligning with
> style="text-alignxx" does work for this.And the text is already centered
> by default. Do you mean something else?
>
> --
> Eliyahu Goldin,
> Software Developer & Consultant
> Microsoft MVP [ASP.NET]
> http://msmvps.com/blogs/egoldin
> http://usableasp.net
>
>
> "Nathan Sokalski" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> As most of us probably know, the <center> tag is deprecated. Because many
>> elements and controls have an align attribute, centering them is easy
>> enough. However, certain elements/controls do not (such as the ASP.NET
>> Button and Label controls). For the ASP.NET label control I usually just
>> add the following attributes:
>>
>> Width="100%" style="text-align:center;"
>>
>> However, this does not work for controls such as the ASP.NET Button
>> control. The only solution I can think of is to nest it inside of <div
>> align="center"></div> tags. However, this could add a lot of extra tags.
>> Any suggestions? Thanks.
>> --
>> Nathan Sokalski
>> (E-Mail Removed)
>> http://www.nathansokalski.com/
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS substitution for the <center> tag Nathan Sokalski ASP .Net 5 01-17-2007 09:03 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
To vlan tag or not to tag? budyerr Cisco 1 07-08-2004 03:45 AM
struts tag inside a tag kishan bisht Java 1 07-08-2003 11:04 PM
How to embed the <jsp:plugin> tag into a tag handler class...HELP !! jstack Java 1 07-04-2003 06:58 PM



Advertisments