twitter-bootstrap 如何设置bootstrap面板的高度、宽度和位置?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43971247/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 00:50:57  来源:igfitidea点击:

How to set height, width and position of panel of bootstrap?

htmlcsstwitter-bootstrap

提问by GoingMyWay

How to set height, width and position of panel of bootstrap?

如何设置bootstrap面板的高度、宽度和位置?

Here is my code

这是我的代码

<div class="panel panel-default">
    <button type="button" class="close" aria-hidden="true">&times;</button>
    <div class="panel-heading">Welcome User!</div>
    <div class="panel-body">
        panel body ....
    </div>
    <div class="panel-footer">panel footer</div>
</div>

And how to set the panel to upper right?

以及如何将面板设置为右上角?

采纳答案by Nirnay Kulshreshtha

.panel.panel-default{
  position: absolute;
  top: 0;
  right: 0;
}

回答by Oleg Markoff

you have typo in panel-default

你在面板默认中有错字

you can use

您可以使用

<div class="row">
  <div class="col-md-4 col-md-offset-8">
    <div class="panel panel-default">
      <button type="button" class="close" aria-hidden="true">&times;</button>
      <div class="panel-heading">Welcome User!</div>
      <div class="panel-body">
          panel body ....
      </div>
    <div class="panel-footer">panel footer</div>
  </div>
</div>

That will make your panel in the top right corner

这将使您的面板位于右上角