흑과학기술!두 줄 코드 완벽 해결: 오버플로우-x:hidden, 오버플로우-y:visible 무효 설정...

19022 단어
잔말 말고 코드로 바로 올라가세요.
DOCTYPE html>
<html>
  <head>
    <style>
      body {
        padding: 0;
        margin: 0;
        height: 800px;
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .parent {
        width: 80vw;
        height: 200px;
        background-color: aqua;
        display: flex;
        align-items: center;
      }
      .wrapper {
        width: 100%;
        display: flex;
        align-items: center;
        overflow-x: hidden;
        overflow-y: visible;
        padding: 500px 0; /*          */
        margin: -500px 0; /*               */
      }

      .imgDiv {
        padding-left: 50px;
      }

      .child {
        width: 70px;
        height: 100px;
      }

      .child:hover {
        transform: scale(4, 4);
      }
    style>
  head>
  <body>
    <div class="parent">
      <div class="wrapper">
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
        <div class="imgDiv">
          <img
            class="child"
            src="https://img1.gamersky.com/upimg/pic/2019/05/27/201905271412133676.jpg"
          />
        div>
      div>
    div>
  body>
html>

참조 링크:
https://stackoverflow.com/questions/6421966/css-overflow-x-visible-and-overflow-y-hidden-causing-scrollbar-issue/39554003#39554003
전재 대상:https://www.cnblogs.com/ImaY/p/11101937.html

좋은 웹페이지 즐겨찾기