font-size引起的页面晃动

如下图中的场景,页面分为头和内容两个大块,head高度是50PX,1PX的border,中间的内容是iframe,高度需要每次进行计算,如下

<script>$(function(){
	setIframeHeight();
})

function setIframeHeight(){
	$("#mainFrame").height(document.body.clientHeight-52);
}

$(window).resize(function() {
  setIframeHeight();
});</script>

IE、Firefox测试下来都OK,结果在测试chrome的时候,发现上下有晃动,之后各种找问题,发现多了5PX。

最终发现是因为div元素的font-size引起的,最后设置font-size:0; 纠结3小时的问题终于解决了。。。

<div class="row">
  <div  class="col-md-12" style="font-size: 0;">
	<iframe  id="mainFrame" name="mainFrame"src="addOrder.html" frameborder="No" marginwidth="0" title="mainFrame" scrolling="auto" style="width: 100%;height:100%;"> </iframe>
  </div>
</div>

  

时间: 2024-12-13 07:29:34

font-size引起的页面晃动的相关文章

Generate eps plot with appropriate font size and line width in GNU Octave

Because eps terminal is different from the one for screen display, the font size and line width should all be adjusted as the following example: clist = GenColorList(); h = 1; figure(h); clf(h); # This is mandatory. ## Set the axis position. Sometime

[Android Tips] 9. framework notification layout font size

android 4.4 framework notification layout 相关字体大小 * title: notification_title_text_size: 18dp * content: notification_text_size: 14dp * subtext: notification_subtext_size: 12dp [Android Tips] 9. framework notification layout font size

unity UGUI text font size对性能影响巨大

Font Size对ugui text的性能影响非常大. <Cube Duck Run>在itouch5上测试是很流畅的,但是在iphone5上测试,在game over后显示历史最高分时却总会卡好几秒,导致游戏体验极差.使用屏蔽法查了两天终于找到了问题的原因,原来显示历史最高分的text的font size设成了150.其实本来font size为50就够了,但是由于text的父节点上有个0.3倍的缩放,所以导致text的font size设成150其大小在屏幕上看起来才会适,当初编辑界面的

latex: font size 修改字体大小的几种方式

参考:Adjusting font size with TikZ picture 调整字体大小的几种方式,大小依次增大,具体如下: \tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \huge \Huge 用法如下: \node (c) at (1,2) {\large x}; 版权声明:本文为博主原创文章,未经博主允许不得转载.

XE6 c++builder 设置 font size GetPropInfo SetOrdProp

TObject* objTemp; objTemp = GetObjectProperty(this, "Font"); if (objTemp) { PPropInfo ppi; ppi = GetPropInfo(objTemp->ClassType(), "Size"); if (ppi && (*ppi->PropType)->Kind == tkInteger) SetOrdProp(objTemp, ppi, 12);

GetPropInfo Font Size

设置font size,遍历所有控件,有的控件没有font属性,所以要用GetPropInfo判断 if (GetPropInfo(cmp, "font")) function GetObjectProperty( const AObject   : TObject; const APropName : string ):TObject; var PropInfo:PPropInfo; begin Result  :=  nil; PropInfo:=GetPropInfo(AObje

LaTeX :font size 修改字体大小的几种方式

调整字体大小的几种方式,大小依次增大,具体如下: \tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \huge \Huge [Reference] 1.Adjusting font size with TikZ picture 原文地址:https://www.cnblogs.com/shenxiaolin/p/10316436.html

小程序倒计时60秒以及解决ios页面晃动问题(前端网备份)

1>小程序ios页面晃动问题,上下晃动是因为机子本身问题,左右问题可以解决.container{padding-bottom: 0;background-repeat: no-repeat;background-size: 100% auto;background-position: bottom center;}包个container2>小程序倒计时60秒 以及倒计时的时候按钮无法点击 ,60秒之后重新<form bindsubmit="formSubmit" bi

UIAlertController custom font, size, color

本文转载至 http://stackoverflow.com/questions/26460706/uialertcontroller-custom-font-size-color up vote2down votefavorite 3 I am using new UIAlertController for showing alerts. I have this code: // nil titles break alert interface on iOS 8.0, so we'll be