【问题标题】:Strange behavior with Magellan Fixed | Foundation 5麦哲伦的奇怪行为已修复 |基础5
【发布时间】:2014-02-21 17:37:26
【问题描述】:

当您购买产品时,我正在尝试创建类似于 Apple 的产品摘要(侧边栏)。我正在使用 Magellan,它似乎会在 960 像素以下的任何宽度处破坏页面。它可能与表有关。我不确定任何帮助或建议将不胜感激。如下图:

.

<div data-magellan-expedition="fixed">
    <div class="large-2 columns right" >
        <div id="top">
            <h5>Summary</h5>
            <h4>Business Cards</h4>
        </div>

        <div id="summary">
            <table>
                <tbody>
                    <tr><td>Digital</td></tr>   
                    <tr><td>3.5 * 2</td></tr>     
                    <tr><td>Qty: 50,000</td></tr>
                    <tr><td>14 Point C2S</td></tr>
                    <tr><td>Color Front, Empty Back</td></tr>      
                    <tr><td>5 Business day turnaround</td></tr>    
                    <tr><td>5 Business day turnaround</td></tr>  
                    <tr><td>5 Business day turnaround </td></tr>
                </tbody>
             </table>

             <h5>Your Price:      $64.5</h5>
             <h5> Unit Cost:      $0.323</h5>
             <a href="#" class="small radius success button">Get Started</a>
        </div>
    </div>
</div>

【问题讨论】:

    标签: javascript css responsive-design zurb-foundation magellan


    【解决方案1】:

    女巫的一个问题可能是表格宽度。尝试添加#top table { width: 100%;}

    由于您使用的是 F5 并且它不支持旧的 IE 浏览器,您可以实现更多的 HTML5 和 CSS3 结构:

    <data-magellan-expedition="fixed">
    <section id='business' class='large-3 medium-12 columns right'>
        <header>
            <h1>Summary</h1>
            <p>Business Cards</p>
        </header>
        <article>
            <table class='debug'>
                <tbody>
                     <tr><td>Digital</td></tr>   
                     <tr><td>3.5 * 2</td></tr>     
                     <tr><td>Qty: 50,000</td></tr>
                     <tr><td>14 Point C2S</td></tr>
                     <tr><td>Color Front, Empty Back</td></tr>      
                     <tr><td>5 Business day turnaround</td></tr>    
                     <tr><td>5 Business day turnaround</td></tr>  
                     <tr><td>5 Business day turnaround </td></tr>
               </tbody>
           </table>
           <p class='price'>Your Price:      </p>
           <p class='price'> Unit Cost:      </p>
           <a href="#" class="small radius success button">Get Started</a>
        </article>
    </section>
    </div>
    

    它更具语义性,并且具有更多逻辑轮廓。您可以在#business 中定位标签:

    #business table { width: 100% }
    #business > header {}
    #business > article {}
    #business > header > h1 {} 
    

    与您的示例相匹配的示例标记:

    .debug {border: 1px solid red;}
    /* Bussines root modifiers */
    #business table { width: 100%;}
    
    /* Bussines #top */
    #business > header {
        /* Target former #top */
    }
    
    #business > header > h1 {
        font-size: 2rem;
        margin: 0px;
        padding: 0px;
    }
    
    #business > header p {
        font-size: 2.5rem;
        margin: 0px;
        padding: 0px;
    }
    
    /* Business #summary */
    
    #business > article {
        /* Target former summary */
    }
    
    /* Price specs */
    .price {
        font-size: 1.4rem;
        font-weight: bold;
        margin: 0px; padding: 0px;
    }
    .price:last-of-type {margin-bottom: .5rem;}
    

    Github 要点 > https://gist.github.com/anonymous/8915089

    如果它不能解决您的问题,请发布更多信息。比如图像中的复选框等等。

    【讨论】:

    • 也使用了F5新的中格。在测试中,magellan 完全没有影响该部分。
    • 我还想到麦哲伦打算用作“粘性导航”......您要完成的是侧边栏保持在视图中的槽滚动不是吗?如果是这种情况,麦哲伦将无济于事……而是使用 position: fixed in your CSS
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-20
    • 2011-07-05
    • 1970-01-01
    • 1970-01-01
    • 2011-06-26
    相关资源
    最近更新 更多