【问题标题】:Bulma same width and same height columns布尔玛同宽同高列
【发布时间】:2021-11-29 13:33:25
【问题描述】:

我需要使用 Bulma css 创建两个具有相同高度和相同宽度的列。 所以我使用列 is-6 来实现相同的宽度,并尝试使用 is-flex 来实现相同的高度。但是当我添加 is-flex 时,高度是相同的,但是 is-6 规则被忽略了。所以我尝试将简单的宽度 100% 添加到包装器 div 中。然后我失去了由 is-flex 添加的相同高度。

这里是JSFiddle example

<!DOCTYPE html>
<html lang="pt-BR">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <title>jQquery sortable lists example</title>
  <!-- Bulma css -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">

  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
  <!--<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/js/bootstrap.min.js"></script>-->
<style>
body, html {
  height: 100%;
  xoverflow: hidden;
  padding: 0!important;
}

body {
    background-color: #e9ecef;
}

.view-wrapper {
}

.nav {
    height: 50px;
    margin-bottom: 50px;
    background-color: #42b983;
}

#visualCards .column {
    height: 100%;
    display: flex;
}

.visualCard {
    width: 100%;
    background-color: white;
    border-radius: 8px;
}
</style>
</head>
<body>    
<div class="nav"></div>
  <div class="container">
        <div id="visualCards" class="columns">
            <div class="column is-6">
                    <div class="columns visualCard">
                        <div class="column is-3">
              aaaa aaa aaaa aaa aaa aaa aaaa aaaa
            </div>
                        <div class="column is-8">
              bbbbb bbb bbbb bbbb bbb bbb bbb bbb
            </div>
                    </div>
            </div>
            <div class="column is-6">
                    <div class="columns visualCard">
                        <div class="column is-3 is-flex">
              aaaa aa aaaaaa
            </div>
                        <div class="column is-8 is-flex">
              bbbb bb bbbbb bb
            </div>
                    </div>
            </div>
        </div>
  </div>    
</body>
</html>

如果您删除 .visualCard width:100% 您将获得相同的高度。 我迷失在其中。感谢您的帮助。

【问题讨论】:

    标签: css flexbox height bulma


    【解决方案1】:

    使用瓷砖是一种选择:

    <div class="tile is-ancestor">
      <div class="tile is-horizontal">
        <div class="tile is-parent">
          <div class="tile is-child box">
            Hello...
          </div>
        </div>
        <div class="tile is-parent">
          <div class="tile is-child box">
            Is it me you're looking for?<br>
            Is it me you're looking for?<br>
            Is it me you're looking for?<br>
            Is it me you're looking for?<br>
          </div>
        </div>
      </div>
    </div>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-11
      • 2017-05-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多