


How to implement a fixed floating DIV at the bottom of the browser (using only css)? _html/css_WEB-ITnose
就在已有的页面用js动态插入一段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> <title>testing</title><style type="text/css">.shape{width:200px; height: 140px; position:fixed!important; position:absolute; right:5px; bottom:5px!important; bottom:auto; top: expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop+(documentElement.clientHeight - this.clientHeight):document.body.scrollTop+(document.body.clientHeight - this.clientHeight));}.shape .con{width:200px; height:100px; background: url(http://static.l99.com/skin/default/images/versus/pk_vote_record.gif) no-repeat;}.shape .btn{width:200px; height:40px; background: url(http://static.l99.com/skin/default/images/versus/pk_vote_record.gif) no-repeat 0 -100px;}.height{height:1300px;}</style></head><body><div class="shape"><div class="con"></div><div class="btn"></div></div><div class="height"></div></body></html>
http://hi.baidu.com/iamzhangxinxu/blog/item/f4b1f550d65cdd10367abe9d.html
<div style="left:0; bottom:0; POSITION:absolute; width:100px; height:100px; z-index:100;">我要固定浮动在底部</div>
到底要底部哪个位置,自己改下left:***
#foot{position:fixed;_position:absolute;bottom:0px;_bottom:0px;_margin-top:expression(this.style.pixelHeight+document.documentElement.scrollTop)}
试下。
我的意思是随便找个页面,粘贴上这段代码,这个div就可以固定浮动在页面最低端,
拖动滚动条浏览始终在最低端
<!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> <title>testing</title><style type="text/css">#foot{position:fixed;_position:absolute;bottom:0px;_bottom:0px;_margin-top:expression(this.style.pixelHeight+document.documentElement.scrollTop)}</style></head><body style="height:5000px;"><div id="foot">我不在下面?</div></body></html>
document.getElementById("shows").style.top=(document.documentElement.scrollTop || document.body.scrollTop)+ieheight-5-showsHeight+"px";
居屏幕底部。
HTML code
这位大哥写的确实没错,
不过我的要求是就一个div标签,
比如新建一个html,内容就是
我不在下面?
保存,不能有body和html,head标签,style就不起作用?
我的意思是随便找个页面,粘贴上这段代码,这个div就可以固定浮动在页面最低端,
拖动滚动条浏览始终在最低端
这个不能用吗?
<div style="left:0; bottom:0; POSITION:absolute; width:100px; height:100px; z-index:100;">我要固定浮动在底部</div>
引用 4 楼 coolzdp 的回复:
我的意思是随便找个页面,粘贴上这段代码,这个div就可以固定浮动在页面最低端,
拖动滚动条浏览始终在最低端
这个不能用吗?
HTML code
不能啊,我的意思是只有div标签,没有body,style就不起作用了好像
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
_overflow : hidden;
}
#container {
_width: 100%;
_height: 100%;
_overflow-y: scroll; > background-color: #0ff;
height: 30px;
width: 100%;
position: fixed;
bottom: 0;
z-index: 999;
/ * ie6 fixed */
_position: absolute;
_bottom:-1px;
_right: 17px;
}
The core style is just two sentences: one is position:fixed, the other One sentence is bottom:0.
zell419’s code is very correct, compatible with both Firefox and IE!
Not bad, very good and powerful
I would like to ask, in this case, can it be used? Also horizontally centered? ? ?
Can horizontal centering be achieved at the same time?
[Quote=Quote 6th floor’s reply:]
document.getElementById("shows").style.top=(document.documentElement.scrollTop || document .body.scrollTop) ieheight-5-showsHeight "px";
This works~~

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...
