div始终在底部

<style type="text/css">
body{margin:0;padding:0;}
div{width:100%;height:100px;background:#fc9;position:absolute;top:100%;margin-top:-100px}
</style>
<div></div>

底部多高它的margin-top 就负多少。保证不留空白。

时间: 2024-08-11 10:14:54

div始终在底部的相关文章

内容高度小于窗口高度时版权div固定在底部

<!doctype html><html><head><meta charset="utf-8"><title>文档内容高度小于窗口高度时底部版权始终在底部-懒人建站</title><meta name="description" content="网站建设中经常遇到文档内容高度小于窗口高度时底部版权始终在底部的问题,纯css不太好解决这个问题,这里使用js代码来对检测文档高度和

始终固定底部菜单

<html><head><title>阿里西西网页特效演示,始终固定底端导航菜单</title></head><body onLoad="fix()" onScroll="fix()" onResize="fix()"><!--用<body onLoad='fix()' onScroll="fix()" onResize="fix()

html DIV始终垂直居中的半透明弹出层特效源代码下载

html DIV始终垂直居中的半透明弹出层特效 原文:html Div层的展开与收缩的特效源代码下载 源代码下载地址:http://www.zuidaima.com/share/1550463332846592.htm <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&g

设定div始终居中显示

<script type="text/javascript"> (function($){ $.fn.extend({ center:function(options){ //center插件 var options=$.extend({ //默认属性值 inside:window, //元素居于窗体中心 transition:0, //元素居中移动时的时间,单位是millisecond minX:0, //元素最小X方向距边值 minY:0, //元素最小Y方向距边值 w

html之div始终停留在屏幕中间部分

需求: 使得某一个div始终停留在屏幕中间 实现: Html代码   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

底部DIV自动位于底部

底部DIV自动位于底部 设置body为绝对定位,最小显示高度为:100%,宽度为:100%: 设置底部显示块为绝对定位,bottom: 0,是body元素的最后一个直接子元素: 设置底部块元素同级元素的上一个兄弟元素的边距可以包含下底部元素即可: <!DOCTYPE html> <html lang="en"> <head> <style> .slibing-div{ border: 2px red solid; height: 200p

让div始终显示在底部

html代码: <div class="container"> <div cass="header"></div> <div class="body"></div> <div class="footer"></div> </div> 注意:千万不能设置.container的高度为100%,否则将无法随滚动条的滚动而滚动. 第一种情况

使Div滚动条始终处于底部

<!DOCTYPE html PUBLIC> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script type="text/javascript"> function add() { var no

css让页脚始终在底部不论页面内容多少

让页脚始终在页面底部,不论页面内容是多或者少页脚始终在页面底部,在某些情况下这些功能还是比较实用的,下面为大家介绍下几种不错的实现方法,大家可以参考下. 方案一: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <style type="text/css"> body,html { margin: 0; padding: 0; height:10