zoukankan      html  css  js  c++  java
  • ie6中利用jquery居中

    1.利用jquery居中代码

    <script type="text/javascript">
    $hwidth=parseInt($(window).width());
    
    $margin=($hwidth-960)/2;/*假定需要居中的块的宽度为960px*/
        $('.er').css('margin-left',$margin+'px');
        
    </script>

    2.利用$('html')取得的宽度比$(window)小

    $('html')取得的宽度不能用做居中依据的计算值

  • 相关阅读:
    StackView
    横竖屏
    Html
    UILabel
    NSString
    NSPredicate|谓词
    iphone
    函数
    UIBezierPath
    UICollectionView
  • 原文地址:https://www.cnblogs.com/zuoxiaobing/p/3577608.html
Copyright © 2011-2022 走看看