在此页http://pjstagingdecorating.com/home-staging-level-2/上,当我调整浏览器大小以模拟窄屏时,每行之间有一个很大的空间。我认为这是因为每个容器的高度都设置为418px。我使用以下CSS将容器的height
更改为auto
,但它无法正常工作。谢谢你的帮助。
.dtp-item-block.dt-portfolio-grid-item.dt_portfolio_grid_6.1.omega {
height:auto!important;
}
.dtp-item-block.dt-portfolio-grid-item.dt_portfolio_grid_6.1 {
height:auto!important;
}
答案 0 :(得分:1)
您可以使用下面的清洁语法来缩小差距。
.dt_portfolio_grid_6 {
height: auto !important;
}
如果您在其他网页上遇到同样的问题,如果在这些网页中使用.dtp-item-block
,则可以通过定位<form action="MAILTO: Dana@dogmother.ca" method="post" enctype="text/plain">
<div class="to">
<input type="text" class="text" name="name" value="Name" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Name';}" style="margin-left: 10px">
<input type="text" class="text" name="email" value="Email" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Email';}" style="margin-left: 10px">
</div>
<div class="to">
<input type="text" class="numbers" name="phone" value="Phone Number" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Phone Number';}" style="margin-left: 10px">
<input type="text" class="text" name="subject" value="Subject" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Subject';}" style="margin-left: 10px">
</div>
<div class="text">
<textarea value="Message:" name="message" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Message';}">Message:</textarea>
</div>
<div>
<input type="submit" value="Send">
</div>
</form>
来减少重置高度到所有网格的使用。
答案 1 :(得分:1)
使用
从style="height: 444px;"
中移除内联样式div
class="dtp-item-block"
答案 2 :(得分:0)
在height: auto
上设置dtp-item-block
本身对我有用。
.dtp-item-block {
height: auto;
}
我将其应用于dtp-item-block
,但您也可以更具体。我在Stylebot(Chrome扩展程序)中尝试过,并且不需要!important
,但这可能是因为它是扩展程序。
答案 3 :(得分:0)
You have a css selector named '1', that's not correct according to the CSS standards. CSS selectors must NOT start with a digit, that said, this selector:
.dtp-item-block.dt-portfolio-grid-item.dt_portfolio_grid_6.1.omega {
height:auto!important;
}
does nothing, but this should do the trick:
.dtp-item-block.dt-portfolio-grid-item.dt_portfolio_grid_6.omega {
height:auto!important;
}
More info here: http://www.w3.org/TR/CSS21/syndata.html#characters