常见css兼容问题
链接的虚线框问题
<!-- html -->
<a class="noDashedBox" href="#"><img src="http://j5.dfcfw.com/image/201406/20140603152217.png" /></a>

/*
* a, img, input等标签点击时会带有虚线框
* 去除它
*/
.noDashedBox {
outline:;
blr:expression(this.onFocus=this.blur());
}

固定定位
<!-- html -->
<a class="fixedTop" href="#"><img src="http://j5.dfcfw.com/image/201406/20140603152217.png" /></a> <a class="fixedBottom" href="#"><img src="http://j5.dfcfw.com/image/201406/20140603152217.png" /></a>

/* css */
.fixedTop {
position:fixed;
top:100px;
left:50%;
margin-left:500px;
_position:absolute;
_top:expression(eval(document.documentElement.scrollTop + 100));
} .fixedBottom {
position:fixed;
bottom:50px;
left:50%;
margin-left:500px;
_position:absolute;
_top:expression(eval(document.documentElement.scrollTop + document.documentElement.clientHeight - 70));
}

png背景图片透明:for ie6
<!-- html -->
<div class="pngOpacity"></div>

// png透明的js解决方案 http://www.zhangxinxu.com/study/js/png.js
if (!window.XMLHttpRequest) {
window.attachEvent("onload", enableAlphaImages);
} function enableAlphaImages(){
for (var i=0; i<document.all.length; i++){
var obj = document.all[i];
var bg = obj.currentStyle.backgroundImage;
var img = document.images[i];
if (bg && bg.match(/\.png/i) != null) {
var img = bg.substring(5,bg.length-2);
var offset = obj.style["background-position"];
obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img+"', sizingMethod='crop')";
obj.style.background = "none";
} else if (img && img.src.match(/\.png$/i) != null) {
var src = img.src;
img.style.width = img.width + "px";
img.style.height = img.height + "px";
img.style.filter ="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='crop')"
img.src = "http://s1.95171.cn/b/img/pixel.gif"; //替换透明PNG的图片
} } }

opacity透明:整个元素透明,包括元素里面的内容
<!-- html -->
<div class="opacity"><span style="color:yellow;">this is opacity text</span></div> <div class="opacity"><span style="color:yellow;position:relative;">this is text that not opacity in ie</span></div>

.opacity {
background: #000;
filter:alpha(opacity=50);
*zoom:; /* sometimes it is needed */
opacity: 0.5;
font-size: 38px;
color:#fff;
}

rgba透明:只对背景透明,内容不会受到影响
<!-- html -->
<div class="rgbaAlpha">red green blue and alpha</div>

/* css */
.rgbaAlpha {
width:300px;
height:auto;
padding:50px;
filter:progid:DXImageTransform.Microsoft.gradient(startcolorstr=#7F000000,endcolorstr=#7F000000);
background: rgba(0, 0, 0, 0.5); font-size: 38px;
color:#fff;
}

常见css兼容问题的更多相关文章
- IE6常见CSS解析Bug及hack
IE6常见CSS兼容问题总结 1)图片间隙 A)div中的图片间隙(该bug出现在IE6及更低版本中) 描述:在div中插入图片时,图片会将div下方撑大三像素. hack1:将</div> ...
- javaScript与css、html常见的兼容
最近几天总是遇到兼容问题,就整理了一下javaScript和html.css出现的常见兼容.有不全面或不对的欢迎大家指正.也希望这条博客可以帮到一些刚学习的前端的朋友. 一.javaScript出现的 ...
- IE常见的兼容处理
IE常见的兼容处理 1. 禁用IE兼容模式 为了保证IE能够使用最新渲染模式而不是兼容模式,在html文档头部应加入以下代码: <head> <meta charset=" ...
- CSS兼容各浏览器的hack
CSS兼容各浏览器的hack:建议:尽可能的手写代码,可以有效的提高学习效率和深度.浏览器的种类多,麻烦自然也多,主要是各种浏览器对某些属性的渲染效果并不相同,所以有时候需要专门针对特定浏览器或者特定 ...
- 主流浏览器css兼容问题的总结
最近又搞了一波网站的兼容,由于要求ie浏览器还是要兼容到ie8,所以调起来还是各种蛋疼. 现在就post一些做兼容的总结,可能不够全面,但是可以告诉大家如何避过一些坑.主要测试了chrome,fire ...
- CSS兼容问题实用建议
CSS兼容问题,是美工最头痛的问题.做测试时,用谷哥和360浏览器(最新)都没有什么问题,用 IE6/IE8测试,问题就冒出来了.微软现在出IE10,我电脑上已经无法用IE6准确测试,IE-TESTE ...
- css兼容问题集合
css兼容问题 兼容问题 1.文字本身的大小不兼容.同样是font-size:14px的宋体文字,在不同浏览器下占的空间是不一样的,ie下实际占高16px,下留白3px,ff下实际占高17px,上留白 ...
- css兼容各个浏览器的三角形图标
css兼容各个浏览器的三角形图标 在当前流行的的网站上,我们经常会看到一些小三角形的下拉提示(微博顶部的下拉菜单),简单的方式可以使用一张图片代替,但是随着前端技术的发展,以及开发者对于前端性能的“吹 ...
- CSS兼容常用技巧
请尽量用xhtml格式写代码,而且DOCTYPE影响 CSS 处理,作为W3C标准,一定要加DOCTYPE声明. 1.div的垂直居中问题 vertical-align:middle; 将行距增加到和 ...
随机推荐
- Problem F
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) ...
- Oracle无安装客户端安装方法
一. 1)下载Oracle客户端:http://www.oracle.com/technetwork/database/features/instant-client/index-097480.htm ...
- 转:SATA协议简介
SATA协议简介 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/FA99999/article/details/70738724 1.概述 本文档主 ...
- initramfs扫描磁盘前改变磁盘上电顺序
背景: 机械硬盘需要12V 5V电源,此前设计是硬件电路默认5V有效.12V无效,然后系统通过驱动上12V电,对磁盘来说相当于先上5V后上12V,这种方式对大部分磁盘是可以的,但对于日立 HGST磁盘 ...
- leetCode 95.Unique Binary Search Trees II (唯一二叉搜索树) 解题思路和方法
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For e ...
- java中异或加密
static String simple_xor(String base_data, String encrypt_key) throws UnsupportedEncodingException { ...
- leetCode 47.Permutations II (排列组合II) 解题思路和方法
Permutations II Given a collection of numbers that might contain duplicates, return all possible un ...
- vue 流程设计器
github地址:https://github.com/280780363/gucflow.designer demo地址:https://280780363.github.io/gucflow.de ...
- Android中的android:layout_width和android:width
最近在看android的东西,发现很多和web前台的东西一样(思想).只是看到很多属性的写法和前台有差别,刚刚看到这样的属性: android:width 其实是定义控件上面的文本(TextView) ...
- python 基础 7.1 datetime 获得时间
一 datatime 的使用 object timedeta tzinfo time data dat ...