首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >网格响应性问题

问网格响应性问题
EN

Stack Overflow用户
提问于 2020-11-01 17:15:49
回答 1查看 39关注 0票数 0

​

代码语言:javascript
复制
.all {
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: 20% 80%;
      grid-template-columns: 20% 80%;
  gap: 1em;
}

.left-side {
  width: 320px;
  height: 869px;
  -webkit-box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);
          box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);
  background-color: #ffffff;
  margin-right: 72px;
}

.left-side .menu {
  padding-top: 51px;
  padding-left: 26px;
}

.left-side .menu h6 {
  height: 12px;
  font-family: "Inter", sans-serif;
  font-size: 10px;
  font-weight: 500;
  font-stretch: normal;
  font-style: normal;
  line-height: normal;
  letter-spacing: 0.6px;
  color: #9fa7bb;
  text-transform: uppercase;
}

.left-side .menu-items {
  list-style: none;
  margin-top: 16px;
}

.left-side .menu-items span {
  height: 31px;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 500;
  font-stretch: normal;
  font-style: normal;
  line-height: 1.47;
  letter-spacing: normal;
  color: #242b39;
  margin-left: 16px;
}

.left-side .menu-items li {
  margin-top: 10px;
  padding: 10px;
}

.left-side .menu-items li:hover {
  border-radius: 8px;
  background-color: #f1f4f8;
  margin-right: 10px;
  margin-left: -18px;
}

.left-side .menu-items img {
  -o-object-fit: contain;
     object-fit: contain;
}

.right-side h2 {
  margin-top: 56px;
  width: 556px;
  height: 37px;
  font-family: "Inter", sans-serif;
  font-size: 31px;
  font-weight: normal;
  font-stretch: normal;
  font-style: normal;
  line-height: normal;
  letter-spacing: -0.37px;
  color: #000000;
}

.right-side .options {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  margin-top: 40px;
}

.right-side .add button {
  width: 30px;
  height: 30px;
  border-radius: 15px;
  -webkit-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
          box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  background-color: #407cff;
  border-style: none;
  color: white;
  font-size: 22px;
  text-align: center;
}
/*# sourceMappingURL=style.css.map */
代码语言:javascript
复制
   <section class="all">
    <section class="left-side">
        <section class="menu">
            <h6>Site Admin</h6>
            <ul class="menu-items">
                <li><img src="./images/online.png" class="icons"><span>Customer Overview</span></li>
                <li><img src="./images/list-dot.png" class="icons"><span>Reports</span></li>
                <li><img src="./images/file-add.png" class="icons"><span>File transcodings</span></li>
                <li><img src="./images/notification.png" class="icons"><span>Notification center</span></li>
            </ul>
        </section>
    </section>

    <section class="right-side">
        <h2>Customer Overview</h2>

        <section class="options">
            <div class="search">
                <input type="text" placeholder="Customer or ID">
            </div>

            <div class="add">
                <button>+</button>
            </div>
            
        </section>
    </section>
    </section>

​

你好,

我需要一个建议,如何使更好和响应式网格。当我在左侧菜单和右侧内容的简单布局时,我遇到了一个问题。我想我做的是对的,但是当我穿较小的尺码时,右边变成左边。有没有办法解决这个问题,这样它就可以响应了?

谢谢你的建议。

EN

回答 1

Stack Overflow用户

发布于 2020-11-02 21:28:38

不太确定我是否正确,但随着屏幕变得越来越小,它必须进行补偿,尝试将所有内容放入一列中。这会导致元素重叠。为了解决此问题,尝试在特定视口中使用媒体查询可能更容易。否则,您可以尝试使元素更小,向.right-side侧添加填充/边距,或增加.all元素的gap值。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64630297

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档