【问题标题】:Attributes from one class carrying over to another...从一个类继承到另一个类的属性......
【发布时间】:2014-05-23 16:37:49
【问题描述】:

请查看Fiddle Here...

我试图在这里分离一些元素,但我遇到了困难。我所有的 div 标签都显示正确分离,但我没有得到分离。

例如,我有一个按钮,然后是清除按钮,然后是段落。

但是,在清除之后,该段落实际上显示在按钮内。

<div id="container">
    <div id="header">Transfer of Credit Estimator</div>
        <div id="content">
            <div id="classes">Enter total number of classes estimated for transfer, then click <strong>Estimate</strong>.
            </div>
            <input type="text" class="" placeholder="#">
        <div id="btn">Estimate<div> <!-- Button -->
    </div>
        <div class="clear"></div>
            <p>Hi</p>

                <div id="footer">**The Estimator is based on classes that would transfer in as 4-credit courses that cost $1,608 each ($402/credit hour) here at University. The Estimator assumes that each class would be a 5-week class.</div> <!-- Footer -->
</div> <!-- Close Container -->
</div>

最重要的是,页脚采用 '.btn' 类的属性,例如字体系列和字体粗细。

想我在这里做错了什么?

【问题讨论】:

    标签: html css


    【解决方案1】:

    按钮 div 未关闭。应该是:

    <div class="btn">Estimate</div>
    

    【讨论】:

    • 我所有的麻烦都在一点“/”上......太棒了!谢谢你抓住它。我还有 10 分钟的时间才能接受。
    • 我只是在我自己的一个项目中被这个问题困扰,所以我分享你的挫败感:-)
    【解决方案2】:

    按钮div没有关闭

    <div id="btn">Estimate<div>
    

    应该是

    <div id="btn">Estimate</div>
    

    您的浏览器会尝试更正您缺少的结束标记并创建要转移的属性

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-03
      • 1970-01-01
      • 2014-04-14
      • 2018-05-05
      • 2020-12-26
      • 2023-03-09
      • 2017-01-16
      • 1970-01-01
      相关资源
      最近更新 更多