<legend id='Tg11M'><style id='Tg11M'><dir id='Tg11M'><q id='Tg11M'></q></dir></style></legend>
<i id='Tg11M'><tr id='Tg11M'><dt id='Tg11M'><q id='Tg11M'><span id='Tg11M'><b id='Tg11M'><form id='Tg11M'><ins id='Tg11M'></ins><ul id='Tg11M'></ul><sub id='Tg11M'></sub></form><legend id='Tg11M'></legend><bdo id='Tg11M'><pre id='Tg11M'><center id='Tg11M'></center></pre></bdo></b><th id='Tg11M'></th></span></q></dt></tr></i><div id='Tg11M'><tfoot id='Tg11M'></tfoot><dl id='Tg11M'><fieldset id='Tg11M'></fieldset></dl></div>
    1. <small id='Tg11M'></small><noframes id='Tg11M'>

        <bdo id='Tg11M'></bdo><ul id='Tg11M'></ul>

        <tfoot id='Tg11M'></tfoot>

        Safari 5.1 打破 CSS 表格单元格间距

        Safari 5.1 breaks CSS table cell spacing(Safari 5.1 打破 CSS 表格单元格间距)
        • <bdo id='piVG4'></bdo><ul id='piVG4'></ul>
              <tbody id='piVG4'></tbody>
            1. <tfoot id='piVG4'></tfoot>
            2. <i id='piVG4'><tr id='piVG4'><dt id='piVG4'><q id='piVG4'><span id='piVG4'><b id='piVG4'><form id='piVG4'><ins id='piVG4'></ins><ul id='piVG4'></ul><sub id='piVG4'></sub></form><legend id='piVG4'></legend><bdo id='piVG4'><pre id='piVG4'><center id='piVG4'></center></pre></bdo></b><th id='piVG4'></th></span></q></dt></tr></i><div id='piVG4'><tfoot id='piVG4'></tfoot><dl id='piVG4'><fieldset id='piVG4'></fieldset></dl></div>
                <legend id='piVG4'><style id='piVG4'><dir id='piVG4'><q id='piVG4'></q></dir></style></legend>

                <small id='piVG4'></small><noframes id='piVG4'>

                  本文介绍了Safari 5.1 打破 CSS 表格单元格间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在更新到 Safari 5.1 之前,我的网站在所有主要浏览器上都运行良好.现在,主要导航被破坏了.我在列表元素中的锚元素上使用 display:table-cell 并且还使用 font-size:0 hack 来删除菜单元素之间的间距.有没有其他人遇到过这个问题并且有他们可以提供的解决方案?

                  My site was working fine across all major browsers right up until the update to Safari 5.1. Now, the primary navigation is busted up. I was using display:table-cell on the anchor element within the list element and was also using the font-size:0 hack to remove the spacing in between menu elements. Has anyone else encountered this issue and have a solution they could offer up?

                  之前:

                  之后:

                  CSS:

                  #navigation {
                    padding-top: 7px;
                  }
                  
                  #navigation ul.links, /* Main menu and secondary menu links */
                  #navigation .content ul /* Menu block links */ {
                    margin: 0;
                    padding: 0;
                    display: block;
                    font-size: 0; /* this is a hack so that the spacing between the menu buttons disappear
                                     since they are inline-block elements, this should be unneccessary when
                                     CSS3 is approved */
                  }
                  
                  #navigation ul.links li, /* A simple method to get navigation links to appear in one line. */
                  #navigation .content li {
                    display: inline-block;
                    padding-right: 0;
                    padding-left: 0;
                    margin: 0;
                  
                    /* below is a fix for IE7 to get the main navigation items lined up correctly
                     * in one row
                     */
                    zoom: 1;
                    *display: inline;
                  }
                  #main-menu ul {
                    width: 100%;
                  }
                  #main-menu li {
                    width: 108px;
                    text-align: center;
                    padding-bottom: 7px;
                    font-size: 11pt;
                  }
                  #main-menu a {
                    display: table-cell;
                    width: inherit;
                    text-decoration: none;
                    font-size: 0.9em;
                    color: #035B9A;
                    background-color: white;
                    height: 30px;
                    vertical-align: middle;
                  }
                  

                  HTML:

                  <div id="navigation">
                      <div class="section">
                          <h2 class="element-invisible">Main menu</h2>
                          <ul id="main-menu" class="links inline clearfix">
                              <li class="menu-379 first"><a href="/about-scrubbed">About Us</a></li>
                              <li class="menu-401"><a href="/" title="">Research</a></li>
                              <li class="menu-385"><a href="/education">Education</a></li>
                              <li class="menu-402"><a href="/" title="">Outreach</a></li>
                              <li class="menu-403 active-trail active"><a href="/news" title="" class="active-trail active">News &amp; Events</a></li>
                              <li class="menu-439"><a href="/people">People</a></li>
                              <li class="menu-405"><a href="/" title="">Resources</a></li>
                              <li class="menu-406"><a href="/" title="">Publications</a></li>
                              <li class="menu-415 last"><a href="/partners">Partners</a></li>
                          </ul>
                      </div>
                  </div>
                  

                  谢谢.

                  请注意,这是一个 Drupal 7 站点.

                  Just a note, this is a Drupal 7 site.

                  我也坦率地承认我在 CSS 标记方面并不是最擅长的.我现在学到了很多东西,只是想勉强度日.

                  Also I freely and humbly admit I am not the very best at CSS markup. I'm learning a lot right now and am just trying to scrape through.

                  推荐答案

                  通过将列表元素显示为块并浮动到左侧来解决.

                  Solved by making the list elements display as block and float them to the left.

                  #navigation ul.links li, /* A simple method to get navigation links to appear in one line. */
                  #navigation .content li {
                    display: block;
                    float: left;
                    padding-right: 0;
                    padding-left: 0;
                    margin: 0;
                  
                    /* below is a fix for IE7 to get the main navigation items lined up correctly
                     * in one row
                     */
                    zoom: 1;
                    *display: inline;
                  }
                  

                  这篇关于Safari 5.1 打破 CSS 表格单元格间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                  How do I make a TextGeometry multiline? How do I put it inside a square so it wraps like html text does inside a div?(如何制作 TextGeometry 多线?如何将它放在一个正方形内,以便它像 html 文本一样包裹在 div 内?) - IT屋-程序员软件开发技术分享社
                  Scale background image to fit ie8 window(缩放背景图像以适合 ie8 窗口)
                  @fontface in IE7 (IETEster) not working properly(IE7 (IETEster) 中的@fontface 无法正常工作)
                  Put in bold part of description in metatag Drupal module(将描述的粗体部分放在元标记 Drupal 模块中)
                  How do I replace a node with an image using D3 and CoffeeScript for a network visualization?(如何使用 D3 和 CoffeeScript 将节点替换为图像以进行网络可视化?)

                    <tfoot id='zGj77'></tfoot>

                    <small id='zGj77'></small><noframes id='zGj77'>

                    • <legend id='zGj77'><style id='zGj77'><dir id='zGj77'><q id='zGj77'></q></dir></style></legend>
                        <tbody id='zGj77'></tbody>

                          <i id='zGj77'><tr id='zGj77'><dt id='zGj77'><q id='zGj77'><span id='zGj77'><b id='zGj77'><form id='zGj77'><ins id='zGj77'></ins><ul id='zGj77'></ul><sub id='zGj77'></sub></form><legend id='zGj77'></legend><bdo id='zGj77'><pre id='zGj77'><center id='zGj77'></center></pre></bdo></b><th id='zGj77'></th></span></q></dt></tr></i><div id='zGj77'><tfoot id='zGj77'></tfoot><dl id='zGj77'><fieldset id='zGj77'></fieldset></dl></div>
                          • <bdo id='zGj77'></bdo><ul id='zGj77'></ul>