PDA

View Full Version : Centering ASPX Websites



atlnycdude24
July 15th, 2008, 02:01 PM
Hello room,

Got a question. Whenever I make websites using the asp.net, how come the website is on the left side of the browser? Is there a way to center it?

atlnycdude24
July 16th, 2008, 01:02 PM
Hello room,

Got a question. Whenever I make websites using the asp.net, how come the website is on the left side of the browser? Is there a way to center it?


anyone???

yell0wdart
July 17th, 2008, 02:38 PM
What XHTML elements (div, table, etc) or ASP.NET controls have you nested your page inside? There's no special way of centering an aspx page... you'd use the same CSS methods you'd use with any other type of web page.

If you've got your page nested inside a div (note: a Panel control will generate a div, I believe an Upate Panel will as well), you'd just use the margin-left and margin-right CSS properties and set them to auto.

If it's all nested inside a table, just set the text-align style of the table to center.

atlnycdude24
April 14th, 2009, 04:10 PM
this may sound late but thanks. actually as of 2009 i can do it using css. now i'm starting to get the hang of div tags. Thanks!