html - 模态弹出窗口溢出

标签 html css

我正在尝试在模态弹出窗口中创建一个溢出。溢出应该只用于水平滚动。但是文本跨越了弹出模式的高度。 这是codepen的链接 http://codepen.io/anon/pen/AKqJf

CSS:

html,body {margin:0; padding:10px; -webkit-backface-visibility:hidden;}
img {width:100%;}
/* text-based popup styling */
.white-popup {
  position: relative;
  background: #FFF;
  padding: 25px;
  width:auto;
  max-width: 400px;
  height: 20px;
  overflow-y:scroll;
  margin: 0 auto; 

}





/* 

====== Zoom effect ======

*/
.zoom-in {

  /* start state */
  .anim {
    opacity: 0;
    transition: all 0.2s ease-in-out; 
    transform: scale(0.8); 
  }

  &.mfp-bg {
    opacity: 0;
      transition: all 0.3s ease-out;
  }

  /* animate in */
  &.mfp-ready {
    .anim {
      opacity: 1;
      transform: scale(1); 
    }
    &.mfp-bg {
      opacity: 0.8;
    }
  }

  /* animate out */
  &.mfp-removing {

    .anim {
      transform: scale(0.8); 
      opacity: 0;
    }
    &.mfp-bg {
      opacity: 0;
    }

  }

}

谢谢

最佳答案

我没有完全理解你的问题,但检查一下

.white-popup {
position: relative;
background: #FFF;
padding: 25px;
width:auto;
max-width: 400px;
height: 100px;
overflow-y:scroll;
margin-top:100px; 
}

关于html - 模态弹出窗口溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25659507/

相关文章:

jquery - 当浏览器窗口高度小于 800 像素时,需要帮助保持嵌套的 div 可见

css - 在页面上使用多个 h1

javascript - 拖放图 block 后如何动态重新排序数组?

css - Rails Google 字体缓存

html - 带有长单词的 CSS 居中文本

php vs htm,奇怪的差距

html - 向我的 HTML div 添加边框会移动我的文本

html - 单击 <a href=></a> 时防止屏幕移动

Javascript 覆盖 CSS 样式不适用于关键帧动画

html - 如何动画扩展/收缩而不是向上/向下