代码之家  ›  专栏  ›  技术社区  ›  Daniel Bruce

Jquery圆角和Div-是否删除间隙?

  •  1
  • Daniel Bruce  · 技术社区  · 7 年前

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     <head>
       <script src="http://www.google.com/jsapi"></script>
       <script>google.load("jquery", "1.2.6")</script>
       <script src="jquery.corners.js"></script>
     </head>
    <body>
    
    <div id="divOuterOuter" style="width: 448px; height: 157px; padding-right:
    0px;padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px;">
    
      <div style="width: 448px; height: 120px; background-color:#d1ddf1; padding-right: 
      0px; padding-left: 0px; padding-bottom: 0px; margin: 0px 0px 25px; padding-top: 
      0px;" 
      id="divOuter" class="rounded {20px}"> 
      </div>
    </div>
    
     <script>$(document).ready( function(){
            $('.rounded').corners();
            });</script>
    </body>
    </html>
    

    提前谢谢!

    问题实例 Example Problem http://image2.humyo.com/I/9176883-444407271/M2QyZmIxYThiMDVhM2NlODYwMjM4MDI2MDA0MmI5Y2I=/450/450/0/1238082866.jpg

    4 回复  |  直到 17 年前
        1
  •  1
  •   Seb    17 年前

    角落插件(至少是我在 http://www.malsup.com/jquery/corner/ )用“角”而不是“角”调用。

    请尝试使用此选项:

    <script type="text/javascript">
      $(document).ready( function(){
        $('.rounded').corner();
      });
    </script>
    

    这在IE 7和Opera 10中对我来说很好。

        2
  •  1
  •   Tyler Rash    17 年前

        3
  •  0
  •   nickf    17 年前

    接下来是一个有争议且可能没有帮助的答案:

    使用:

    -moz-border-radius      /* for firefox */
    -webkit-border-radius   /* for webkit browsers */
    

        4
  •  0
  •   user100282    17 年前

    Firebug add-on 使跟踪类似这样的CSS问题变得更加容易。您可以使用“inspect”并选择有问题的对象,并在FireBug中动态编辑CSS,以确定造成间隙的原因。