IE6下绝对定位元素存在1px偏差问题
2017-02-17 10:32
399 查看
小知识:IE6下面绝对定位元素父级的宽高是奇数,绝对定位元素 设置 right:0;bottom:0; 在IE6中会有1px的偏差。
解决方案: 避免父级宽高出现奇数。
代码:
效果图:
新手上路,欢迎反驳!
解决方案: 避免父级宽高出现奇数。
代码:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .box{ width: 307px; height: 307px; background-color: red; position: absolute; } .content{ width: 100px; height: 100px; background-color: blue; position: absolute; right: 0; bottom: 0; } </style> </head> <body> <div class="box"> <div class="content"></div> </div> </body> </html>
效果图:
新手上路,欢迎反驳!
相关文章推荐
- 绝对定位在IE6下存在left和bottom的定位错误问题
- 解决 IE6 不支持绝对定位 fixed 以及IE6下被绝对定位的元素在滚动的时候会闪动的问题
- IE6中绝对定位元素消失问题
- 当子级元素浮动时让父级元素高度自适应的三种方法(以及多个子集元素同时存在浮动和绝对定位时的问题的解决办法)
- ie6中,里面元素绝对定位时,外层元素一定要给高度。
- IE6 7下绝对定位引发浮动元素神秘消失
- ie6绝对定位 bottom问题
- 【IE6的疯狂之十】父级使用padding后子元素绝对定位的BUG(2010年3月30日更新)
- 【css】绝对定位的元素在 ie6 下不显示
- ie6绝对定位的块会被select元素遮挡的解决方案
- IE6中多个绝对定位和相对定位重叠时z-index失效的问题
- IE6 绝对定位元素的 1px 间距 bug(转自:http://www.99css.com/archives/53)
- 在进行页面的DIV CSS排版时,遇到IE6(当然有时Firefox下也会偶遇)浏览器中的图片元素img下出现多余空白的问题绝对是常见的对于该问题的解决方法也是“见机行事”。
- IE6父级使用padding后子元素绝对定位的BUG
- 当浮动元素和绝对定位元素是并列关系的时候,在IE6下绝对定位元素会消失
- IE6 下父级(relative)使用padding后,子元素绝对定位(absolute)的bug
- 父元素绝对定位 子元素在IE6 不能点击
- 父元素绝对定位 子元素在IE6 不能点击
- 解决IE6 下 position:fixed 绝对定位的问题
- 在IE6下绝对定位元素的父级宽高是奇数的时候,元素的right值和bottom值会有1px的偏差