html - 将屏幕分成两个独立的相等部分 ionic 3

标签 html css ionic-framework ionic3

目前,它们不相等:

<div class="homescreen-content" scroll="false">
  <h2>Top</h2>
  ITEM 1
  <hr>
  <h2>Bottom</h2>
  ITEM 2
</div>

我想平均分割屏幕,并希望它能够响应并居中。 有没有办法用 SplitPane 做到这一点?

enter image description here

最佳答案

.homescreen-content {
    height: 100%;
    display: flex;
  }
.split {

    position: fixed;
    z-index: 1;
    top: 0;
    overflow-x: hidden;
    padding-top: 20px;
    
}

.test1 {
    left:0;
    height: 55%;
    width: 100%;
    background-color: $white-love;
    border-bottom: 2px solid;
}

.test2 {
    
    left:0;
    top: 55%;
    height: 50%;
    width: 100%;
    background-color: $white-love;
}

.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
This is may work:

<div class="homescreen-content" scroll="false">
        <div class="split test1">
                <div class="centered">
                  <h2>TEST1</h2>
                   </div>
              </div>
              <hr>
              <div class="split test2">
                <div class="centered">
                  <h2>TEST</h2>
                </div>
              </div>
</div>

关于html - 将屏幕分成两个独立的相等部分 ionic 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50486455/

相关文章:

javascript - 滚动后固定导航栏

javascript - 使用 jQuery 和 Bootstrap 设计复选框按钮的样式

css - 水平菜单栏中的按钮大小相同?

html - 如何修复 CSS 中的重叠图像?

html - 推/拉多行列

html - 如何在选择列表中添加图像?

ionic-framework - Ionic v2 如何在标题中插入 Logo

javascript - 如何使用 ionic 在 Angular JS 中制作自定义指令?

angularjs - ionic 和 FB.AppEvents.activateApp();问题

html - CSS使文字显示在图片下方