how to reduce the div height

前端 未结 4 722
清酒与你
清酒与你 2021-01-23 20:44
相关标签:
4条回答
  • 2021-01-23 21:23

    You need to use max-height not min-height!

    div{
    max-height: 100px;
    height: 100%;
    }
    
    0 讨论(0)
  • 2021-01-23 21:32

    use max-height instead. It will work fine. the min- height wont work on div.

    0 讨论(0)
  • 2021-01-23 21:32

    A div's height depends on its inner elements, in your example, the first input is having a height of 100px, so the div will have at least 100px height, ignoring spacing, boarder, padding. Setting max-height on the div will hint the rendering engine to limit the height, but doesn't necessarily work all the time.

    I'd suggest you changing the input's height first:

    <input style="max-height: 100px" type="text" name="Client" id="Client" readonly="readonly" class="m-wrap span4 clrField" tabindex="1" />
    
    0 讨论(0)
  • 2021-01-23 21:43
    <div class="row-fluid" style="height:100px">
    ..............
    ..........
    </div>
    
    0 讨论(0)
提交回复
热议问题