【问题标题】:Make others text div change size when one text div changes [duplicate]当一个文本div更改时,使其他文本div更改大小[重复]
【发布时间】:2018-08-21 10:10:50
【问题描述】:

我有以下文本 div。

.owners{
  margin: 0px 20px 0px 20px;
}
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="row owners">
    <div class="col-sm-3 text-center" style="background-color:lavender;overflow-wrap:break-word;">Owner</div>
    <div class="col-sm-3 text-center" style="background-color:lavenderblush;overflow-wrap:break-word;">Owner</div>
    <div class="col-sm-3 text-center" style="background-color:lavender;overflow-wrap:break-word;">Owner</div>
     <div class="col-sm-3 text-center" style="background-color:lavender;overflow-wrap:break-word;">Owner</div>
  </div>

或以下链接:https://codepen.io/Lamdepzai123/pen/RJqPqq

当我编辑文本 div 的内容时,文本会环绕,使一个 div 改变它的大小。我想知道如何让其他三个 div 根据那个 div 改变它的大小。

我非常感谢任何帮助。

【问题讨论】:

  • size 你的意思是height 对吗?

标签: javascript jquery html css twitter-bootstrap-3


【解决方案1】:

添加这个css:

.owners{
  margin: 0px 20px 0px 20px;
  flex-wrap: wrap;
   display: flex;
   justify-content: center;
}
.text-center{
    display: flex;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

这里是the updated codepen

【讨论】:

    【解决方案2】:

    添加这个 CSS !我希望解决你的问题。

    .row{
        overflow: hidden; 
    }
    
    [class*="col-"]{
        margin-bottom: -99999px;
        padding-bottom: 99999px;
    }
    

    【讨论】:

      猜你喜欢
      • 2013-03-04
      • 1970-01-01
      • 2020-08-12
      • 2010-11-09
      • 1970-01-01
      • 1970-01-01
      • 2011-09-01
      • 2017-03-19
      • 2023-04-08
      相关资源
      最近更新 更多