CSS Overflow-x隐藏和Overflow-y [英] CSS Overflow-x Hidden and Overflow-y

查看:505
本文介绍了CSS Overflow-x隐藏和Overflow-y的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通读了这个问题,没有看到我的问题有解决方案.

I read through this question and didn't see if there is a solution to my issue.

我创建了显示此问题的 CodePen .我希望隐藏红色边框的左侧和右侧(overflow-x)的所有内容,但保持顶部和底部(overflow-y)可见.

I've created a CodePen that shows this issue. I would like everything to the left and right (overflow-x) of the red border to be hidden, but keep the top and bottom (overflow-y) visible.

关于如何实现这种影响的任何想法?

Any ideas on how to achieve this affect?

推荐答案

将您的.movi​​e-posters样式更新为此.并检查这是否是您想要的.

update your .movie-posters style to this. And check if this is what you are looking for.

.movie-posters {
  position: relative;
  width: 800px;
  height: 450px;
  margin: 6rem auto;
  border: 4px solid red;
  overflow-x:hidden;
}

我不得不增加高度以使其看起来正常.

i had to increase the height to make it look normal.

这篇关于CSS Overflow-x隐藏和Overflow-y的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆