如何将div标签中的内容固定在页面底部
展开全部
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style>
*{margin: 0;padding: 0;}
img{position: relative; left: 0; top: 100px; }
.div1{height: 100px; background: green; position: fixed; bottom: 0; left: 0;}
</style>
</head>
<body style="height:2000px;">
<div class="div1">asdf</div>
<script>
$(".div1").width($(window).width());
</script>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style>
*{margin: 0;padding: 0;}
img{position: relative; left: 0; top: 100px; }
.div1{height: 100px; background: green; position: fixed; bottom: 0; left: 0;}
</style>
</head>
<body style="height:2000px;">
<div class="div1">asdf</div>
<script>
$(".div1").width($(window).width());
</script>
</body>
</html>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询