开发者

How to center my asp.NET panels?

开发者 https://www.devze.com 2023-03-06 20:19 出处:网络
I\'ve got panels containing tables to organize textboxes/labels, and I\'d like to center them, but I can\'t figure out what attribute to use. I\'ve tried to justify them in the design view, and horizo

I've got panels containing tables to organize textboxes/labels, and I'd like to center them, but I can't figure out what attribute to use. I've tried to justify them in the design view, and horizontalalign:center in h开发者_运维技巧tml, but to no avail. What's the best way to center panels containing tables?


I would apply CSS to them:

div.myPanelCss
{
    margin-left: auto;
    margin-right: auto;
}

I believe Panels render as a div


You can generally center a table by using margin: auto;.


Apply the following CSS rule for your panel (surrounding div would work):

.centerPanel
{
  margin 0 auto;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消