Html 需要版权才能保持到底

Html 需要版权才能保持到底,html,css,css-float,Html,Css,Css Float,以下是html: <div id="terms" class="terms"> <center><a href="terms.html">Terms & Conditions</a> </div> 我做错了什么?我尝试了大概50种不同的html和css变体,以使术语保持在页面底部,但它在页面中心浮动。它会从顶部到中间,从右到左,但我不能让它浮动到页面底部!整个页面设置为两个浮动列。right和。left 请帮忙

以下是html:

<div id="terms" class="terms">
        <center><a href="terms.html">Terms & Conditions</a>
</div>
我做错了什么?我尝试了大概50种不同的html和css变体,以使术语保持在页面底部,但它在页面中心浮动。它会从顶部到中间,从右到左,但我不能让它浮动到页面底部!整个页面设置为两个浮动列
。right
。left


请帮忙!!谢谢大家!

我为你摆好了一把小提琴:

按如下方式修改您的代码:

HTML

<div class="terms">
  <center><a href="terms.html">Terms & Conditions</a></center>
</div>

希望这能有所帮助。

我为您准备了一把小提琴:

按如下方式修改您的代码:

HTML

<div class="terms">
  <center><a href="terms.html">Terms & Conditions</a></center>
</div>

希望这有帮助。

请参考下面的演示

HTML

<div class="wrapper">
    <div id="terms">
        <center><a href="terms.html">Terms &amp; Conditions</a></center>
    </div>
</div>
<div class="wrapper">
    <div class="pageBox">
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
    </div>

    <div id="terms">
        <center><a href="terms.html">Terms &amp; Conditions</a></center>
    </div>
</div>

根据评论更新:

HTML

<div class="wrapper">
    <div id="terms">
        <center><a href="terms.html">Terms &amp; Conditions</a></center>
    </div>
</div>
<div class="wrapper">
    <div class="pageBox">
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
    </div>

    <div id="terms">
        <center><a href="terms.html">Terms &amp; Conditions</a></center>
    </div>
</div>

请参考下面的演示

HTML

<div class="wrapper">
    <div id="terms">
        <center><a href="terms.html">Terms &amp; Conditions</a></center>
    </div>
</div>
<div class="wrapper">
    <div class="pageBox">
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
    </div>

    <div id="terms">
        <center><a href="terms.html">Terms &amp; Conditions</a></center>
    </div>
</div>

根据评论更新:

HTML

<div class="wrapper">
    <div id="terms">
        <center><a href="terms.html">Terms &amp; Conditions</a></center>
    </div>
</div>
<div class="wrapper">
    <div class="pageBox">
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
        <p>
        This is test page height will be managed accordingly and footer will be attached after this box.
        </p>
    </div>

    <div id="terms">
        <center><a href="terms.html">Terms &amp; Conditions</a></center>
    </div>
</div>

是否要将页脚粘贴到页面底部,而不管其中有多少内容?-,这就是我想要将页脚锚定到底部时使用的方法(尽管从您的示例页面看,它可能不是您想要的)

还是只想确保它位于页面中最后一项的下方?为什么不在最后一个项目下方和条款之前添加清算div/br

.clearboth {
    font-size: 1px;
    line-height: 0px;
    clear: both;
    height: 0px;
}

<br class="clearboth" />
。两者都清除{
字号:1px;
线高:0px;
明确:两者皆有;
高度:0px;
}

然后,不管两边的浮子是什么,你都可以把你的div作为一个普通物品放在它下面


希望这两个选项中的任何一个对您有所帮助

您是否希望将页脚粘贴到页面底部,而不管其中包含多少内容?-,这就是我想要将页脚锚定到底部时使用的方法(尽管从您的示例页面看,它可能不是您想要的)

还是只想确保它位于页面中最后一项的下方?为什么不在最后一个项目下方和条款之前添加清算div/br

.clearboth {
    font-size: 1px;
    line-height: 0px;
    clear: both;
    height: 0px;
}

<br class="clearboth" />
。两者都清除{
字号:1px;
线高:0px;
明确:两者皆有;
高度:0px;
}

然后,不管两边的浮子是什么,你都可以把你的div作为一个普通物品放在它下面



希望这两种方法都有帮助

首先,您使用css样式id和类选择器为同一元素指定了两个不同的位置。这不是一个使用样式表的好方法。你能粘贴完整的html吗?它不会让我@Exor它超过5000个字符太长。您使用中心标记。HTML5最大的禁忌首先,您使用css样式id和类选择器为同一元素指定了两个不同的位置。这不是一个使用样式表的好方法。你能粘贴完整的html吗?它不会让我@Exor它超过5000个字符太长。您使用中心标记。我用你的代码替换了我的代码,它也做了同样的事情。它在我的屏幕底部居中,但不是在我的页面底部。这意味着,问题存在于代码的其余部分。你能粘贴完整的html吗?它说它太长了5000个字符实际上是和/sample-ads.htmlremove位置:绝对;从你的css。我用你的代码替换了我的代码,它做了同样的事情。它在我的屏幕底部居中,但不是在我的页面底部。这意味着,问题存在于代码的其余部分。你能粘贴完整的html吗?它说它太长了5000个字符实际上是和/sample-ads.htmlremove位置:绝对;从你的css。这会将它附加到我的屏幕上,而不是页面上。请在您的评论之后参考上面我回答中的演示2。@ryan:这个解决方案会起作用的。“terms”分区将粘贴到“pageBox”分区的底部。我想这就是您要查找的内容。我遵循了以下内容。。。。术语&停留在页面顶部,条件进入底部?@ryan是
宽度100%
还是您在术语div中使用了
float:left
。这会将其附加到我的屏幕上,而不是页面请在您的评论后参考我上面回答中的演示2。@ryan:这个解决方案会起作用。“terms”分区将粘贴到“pageBox”分区的底部。我想这就是您要查找的内容。我遵循了以下内容。。。。术语&停留在页面顶部,条件进入底部?@ryan是
宽度100%
还是您在术语div中使用
float:left