开发者

How to center my asp.NET panels?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜