|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CSS substitution for the <center> tagAs 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. <div align='center'>
</div> -- Show quoteHide quoteHappy Hacking, Gaurav Vaish | www.mastergaurav.com www.edujini-labs.com http://eduzine.edujinionline.com ----------------------------------------- "Nathan Sokalski" <njsokal***@hotmail.com> wrote in message news:%23EDescQOHHA.4604@TK2MSFTNGP06.phx.gbl... > 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 > njsokal***@hotmail.com > http://www.nathansokalski.com/ > 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. Show quoteHide quote "Gaurav Vaish (MasterGaurav)" <gaurav.vaish.nospam@nospam.gmail.com> wrote in message news:%23Cg6aOROHHA.3916@TK2MSFTNGP02.phx.gbl... > <div align='center'> > </div> > > > -- > Happy Hacking, > Gaurav Vaish | www.mastergaurav.com > www.edujini-labs.com > http://eduzine.edujinionline.com > ----------------------------------------- > > > "Nathan Sokalski" <njsokal***@hotmail.com> wrote in message > news:%23EDescQOHHA.4604@TK2MSFTNGP06.phx.gbl... >> 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 >> njsokal***@hotmail.com >> http://www.nathansokalski.com/ >> > > Do you mean aligning the text inside a button? Aligning with
style="text-align:xxx" does work for this.And the text is already centered by default. Do you mean something else? -- Show quoteHide quoteEliyahu Goldin, Software Developer & Consultant Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net "Nathan Sokalski" <njsokal***@hotmail.com> wrote in message news:%23EDescQOHHA.4604@TK2MSFTNGP06.phx.gbl... > 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 > njsokal***@hotmail.com > http://www.nathansokalski.com/ > 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. Show quoteHide quote "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in message news:OPDWWxUOHHA.4172@TK2MSFTNGP04.phx.gbl... > Do you mean aligning the text inside a button? Aligning with > style="text-align:xxx" 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" <njsokal***@hotmail.com> wrote in message > news:%23EDescQOHHA.4604@TK2MSFTNGP06.phx.gbl... >> 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 >> njsokal***@hotmail.com >> http://www.nathansokalski.com/ >> > >
What's the new thing after ActiveX?
AJAX n00b - custom server control in an UpdatePanel causes full postback Menu - Eliminate The Triangular Arror pointer thing - How to do it? Web page size html text encoding problem Problems with Flash in WebBrowser Programmatically modifying the controls in FormView's PagerTemplate Gridview controls added programmatically does not appear later Gridview only displays 3 columns of 11 column dataset dropdown SelectedIndexChanged not working on IE |
|||||||||||||||||||||||