如何制作一个固定的div? [英] How to make a fixed div?

查看:110
本文介绍了如何制作一个固定的div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将框固定在页面的右下边框,并且不随页面向下滚动而移动。但它不适合我为什么不工作。这里是我的代码:

 < html> 
< head>

< style type =text / css>

.tooltip {
width:200px;
位置:固定;
top:auto;
bottom:0px;
right:0px;
left:auto;
}
< / style>
< / head>
< body>
< div class =tooltip>
< div class =tooltip_top> 1< / div>
< div class =tooltip_con> 2< / div>
< div class =tooltip_bot> 3< / div>
< / div>
< / body>
< / html>


解决方案

p>

旧版本的IE不支持 position:fixed 正确..不知道最新版本..



同时请确保您已经定义了文档类型。


I am trying to make box to be fixed in the lower right border of the page and doesn't move with the page scrolls down. But it's not working for me dunno why. Here is my code:

<html>
 <head>

 <style type="text/css">

.tooltip {
 width: 200px;
 position: fixed;
 top:auto;
 bottom:0px;
 right:0px;
 left:auto;
}
 </style>
 </head> 
<body>
<div class="tooltip">
   <div class="tooltip_top">1</div>
   <div class="tooltip_con">2</div>
   <div class="tooltip_bot">3</div>
 </div>
</body>
</html>

解决方案

It works fine in FF and Chrome ..

older versions of IE did not support position:fixed correctly .. not sure about latest version..

Also make sure you have a doctype defined ..

这篇关于如何制作一个固定的div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆