粘滞的页脚不在移动设备上工作

时间:2018-04-05 08:47:40

标签: html css mobile layout

我想为我的卡路里计算器创建一个粘性/浮动底部页脚,事实上,它在桌面上运行良好,但在移动设备上却不行。任何想法可能是什么问题?

HTML:

<footer class="footer">
    <div class="summary">
        <table id="nodecor">
            <tr>
                <th>Total Calories: </th>
                <th>Carbs: </th>
                <th>Fat: </th>
                <th>Protein:</th>
            </tr>
            <tr>
                <td class="bigtext"><span id="total">0</span> G</td>
                <td class="bigtext"><span id="totalCarbs">0</span> G</td>
                <td class="bigtext"><span id="totalFats">0</span> G</td>
                <td class="bigtext"><span id="totalProteins">0</span> G</td>
            </tr>
        </table>
    </div>
</footer>

CSS:

    .footer {

  padding: 10px;
  height:15%;
  position: fixed;
  width:100%;
  bottom: 0;
  left: 0;
  right: 0;
}

这是Codepen link,因为它可能更容易可视化。

感谢任何帮助!

1 个答案:

答案 0 :(得分:0)

您遇到问题的原因似乎是您错误的HTML代码格式。请尝试使用此格式来处理您在问题中提到的html代码。

S = [x[0] for x in content_E.most_common(3)]
相关问题