可以使用 CSS 中的 position 属性来设置页面底部的固定版权信息。 具体步骤如下:
<div class="footer">版权信息</div>
.footer {
position: fixed;
bottom: 0;
width: 100%;
background-color: #f2f2f2;
text-align: center;
}
在上述代码中,我们使用了 position: fixed; 将版权信息固定在页面底部。同时,我们使用了 bottom: 0; 将版权信息与页面底部对齐。我们还使用了 width: 100%; 来使版权信息的宽度与页面宽度相同。最后,我们设置了一个背景颜色和居中的文本对齐方式。
需要注意的是,如果页面内容过少,版权信息可能会出现在页面中间,这时我们可以使用 min-height 或者 padding-bottom 来设置一个最小高度,或者在页面中添加一些占位元素,使内容填满整个页面。
关键词高亮:position, fixed, bottom, width, background-color, text-align.