Html 模态高度和宽度调整

Html 模态高度和宽度调整,html,css,wordpress,twitter-bootstrap,bootstrap-modal,Html,Css,Wordpress,Twitter Bootstrap,Bootstrap Modal,尝试调整模态的高度和宽度,但是没有任何运气 我试过: max-height: 80vh; // & & 所有人都会对模态做一些非常“奇怪”的事情。也就是说,把它移到屏幕的左边,实际上不要使它变大。以下是我的模式CSS: modal-dialog { position: relative; width: auto; margin: 10px; } .modal-content { position: relative; background-color: #EBEAEA;

尝试调整模态的高度和宽度,但是没有任何运气

我试过:

 max-height: 80vh; //
&

&

所有人都会对模态做一些非常“奇怪”的事情。也就是说,把它移到屏幕的左边,实际上不要使它变大。以下是我的模式CSS:

modal-dialog {
  position: relative;
  width: auto;
  margin: 10px;
}
.modal-content {
  position: relative;
  background-color: #EBEAEA;
  border: 1px solid #999;
  border: 1px solid transparent;
  border-radius: 4px;
  -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
  background-clip: padding-box;
  outline: 0;
  max-height: 100px;
  max-width: 100px;
}
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  background-color: #000;
}
.modal-backdrop.fade {
  opacity: 0;
  filter: alpha(opacity=0);
}
.modal-backdrop.in {
  opacity: 0.5;
  filter: alpha(opacity=50);
}
.modal-header {
  padding: 20px;
  border-bottom: 1px solid transparent;
}
.modal-header .close {
  margin-top: -2px;
}
.modal-title {
  margin: 0;
  line-height: 1.5384616;
}
.modal-body {
  position: relative;
  padding: 20px;  
}
.modal-footer {
  padding: 20px;
  text-align: right;
  border-top: 1px solid transparent;
}
任何指向正确方向的指针都会有帮助

jsFiddle:

谢谢大家!

试试这个css

@media (min-width: 992px){
    .modal-dialog {
        width: 1024px !important;
        margin: 30px auto;
        max-width: 1024px !important;
    }
}

您能在JSFIDLE或codepen中实现这一点吗?不幸的是,即使在添加CDN之后,您的代码似乎也无法在JSFIDLE中工作。一定要检查你的代码谢谢,可能是因为我只添加了模态部分,其余的部分很难处理。你很好。问题是什么?再次感谢-感谢您的帮助,但似乎不起作用。我有一个额外的括号在那里,对不起。它还没有调整模式大小。。。。不确定发生了什么。您在哪里添加了此css?清除缓存并选中我已将此添加到bootstrap.css文件:)
modal-dialog {
  position: relative;
  width: auto;
  margin: 10px;
}
.modal-content {
  position: relative;
  background-color: #EBEAEA;
  border: 1px solid #999;
  border: 1px solid transparent;
  border-radius: 4px;
  -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
  background-clip: padding-box;
  outline: 0;
  max-height: 100px;
  max-width: 100px;
}
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  background-color: #000;
}
.modal-backdrop.fade {
  opacity: 0;
  filter: alpha(opacity=0);
}
.modal-backdrop.in {
  opacity: 0.5;
  filter: alpha(opacity=50);
}
.modal-header {
  padding: 20px;
  border-bottom: 1px solid transparent;
}
.modal-header .close {
  margin-top: -2px;
}
.modal-title {
  margin: 0;
  line-height: 1.5384616;
}
.modal-body {
  position: relative;
  padding: 20px;  
}
.modal-footer {
  padding: 20px;
  text-align: right;
  border-top: 1px solid transparent;
}
@media (min-width: 992px){
    .modal-dialog {
        width: 1024px !important;
        margin: 30px auto;
        max-width: 1024px !important;
    }
}