div set height equal

后端 未结 4 1264
不知归路
不知归路 2021-01-26 00:57

I have 3 divs. How can I make them equal if the other div height adjust. I want all my divs to adjust its height even do they have less co

相关标签:
4条回答
  • 2021-01-26 01:16

    CSS:

    .column-wrapper { overflow: hidden; }
    
    .column-small {
       float: left;
       margin: 20px;
       background-color: red;
       padding-bottom: 1000px;
       margin-bottom: -1000px;
    }
    
    .column-small span { float: right; }
    
    .column-small ul {
       margin-top: -10px;
       width: 100%;
       max-width: 240px;
    }
    
    .column-small ul li { text-align: left; }
    
    .column-small li {
       list-style: none;
       padding: 5px;
       text-indent: -30px;
       word-wrap: break-word;
    }
    

    HTML:

    <div class="column-wrapper">
       <div class="column-small border  border-top"> 
          <h3>Features</h3>
    
          <ul>
             <li>Code blocking</li>
             <li>Code Wrapping</li>
             <li>Code Killing</li>
             <li>Code Sleeping</li>
          </ul>
    
          <span><a href="#">Read more</a></span>
       </div>
    
       <div class="column-small border  border-top"> 
          <h3>Modules</h3>
    
          <ul>
             <li>Barking Around The house</li>
             <li>Loving the Cats</li>
             <li>Floating The points</li>
             <li>Coding The Sleepers</li>
          </ul>
    
          <span><a href="#">Read more</a></span>
       </div>
    
       <div class="column-small border  border-top"> 
          <h3>Idont knows</h3>
          <span><a href="#">Read more</a></span>
       </div>
    </div>
    
    0 讨论(0)
  • 2021-01-26 01:19

    first part looks like a duplicate from https://stackoverflow.com/a/10235116/1902425

    to your second part: if you're doing it with js, your height is dynamically calculated, so you can postion your "Read More" link wir position: absolute little example:

    <div class="column-small">
          <div class="column-content">
              <h3>Idont knows</h3>
              <p>Your content</p>
          </div>
          <div class="readmore"><a href="#">Read more</a></div>
     </div>
    

    CSS:

    .column-small {
         position: relative;
         height: 240px;
    }
    .readmore {
        position: absolute;
        bottom: 10px;
        right: 10px;
    }
    
    0 讨论(0)
  • 2021-01-26 01:22
    .column-small{
        height: inherit !important;
    }
    
    0 讨论(0)
  • 2021-01-26 01:39

    Set the height for .column-small div.

    0 讨论(0)
提交回复
热议问题