【问题标题】:CSS Form alignment great in Chrome but off for FirefoxCSS 表单对齐在 Chrome 中很好,但在 Firefox 中关闭
【发布时间】:2014-07-15 13:36:57
【问题描述】:

以下页面http://drivenowcard.com/form.php 在 Chrome 上运行良好,但在加载 Firefox 时,您会注意到表单偏向右侧。

我是 CSS 新手,所以我做错了什么,或者 Firefox 与 Chrome 有什么不同?

HTML

<div id="beforeForm">
    <h2 id="customer" class="textFont">Customer Information</h2><h2 onclick="redirect('http://drivenowcard.com/privacy.php');" id="privacy">Privacy Notice</h2>
    <p hidden="" id="required">* Indicates a required Field</p>
</div>

<form id="actionForm" action="ajax/process.php" method="post">
    <!-- form contents -->
</form>

注意: 此项目正在使用 Bootstrap 3

【问题讨论】:

    标签: css forms twitter-bootstrap google-chrome firefox


    【解决方案1】:

    您需要清除从以下位置级联的左浮动:&lt;h2 id="customer" class="textFont"&gt;

    这是 CSS 中的浮点数(不要更改)

    #customer {
        float: left;
    }
    

    这是您需要添加到样式表以清除浮动的 CSS

    #actionForm { 
        clear: left;
    }
    

    【讨论】:

    • 完美运行!谢谢!
    猜你喜欢
    • 1970-01-01
    • 2016-07-21
    • 1970-01-01
    • 2012-11-18
    • 1970-01-01
    • 1970-01-01
    • 2013-04-14
    • 2014-06-30
    • 1970-01-01
    相关资源
    最近更新 更多