使图像坚持下去

  • 本文关键字:坚持 图像 css
  • 更新时间 :
  • 英文 :


我有一个弹出的模态,我正在使用u-uizizable。问题是,如果模态高(因此具有设定的高度可以具有滚动),则图像会带有滚动。我无法修复它,因为如果您抓住它并水平或垂直移动模态移动。不知道该怎么办。目前,它位于模式的右下角。如果需要,也可以使用jQuery。

https://jsfiddle.net/x7dw1wjg/

html

 <div class="ui-dialog">
    <div class="container">//contains everything in the modal</div>
    <div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se">
 </div>

CSS

 .ui-dialog{
   width: 900px;
   height; auto;
   overflow: auto;
  }
 .ui-resizable-handle {
 width: 22px;
 height: 22px;
 right: 0px;
 bottom: 0px;
 background-position: -77px -220px; // this is just the icon
 position: absolute;
 }
 .container {
 position: relative;
 padding: 1em;
 overflow: auto;
 width: auto;
 max-width: 900px;
 height: 600px;
 }
.container img {
height:0;
width:50%
padding-bottom: 50%;
}

这将始终使图像正方形以其宽度设置为高度。

最新更新