Archive for the ‘css’ Category

css锚点定位偏移原理兼容浏览器

不知道有没有人研究过这个,当点击页面的锚点连接的时候一般就跳转到特定id的元素,而实际表现的是滚动条滚动使该特定id元素对齐滚动条所处元素的顶端。

那假如我现在要求这个位置不是在顶端,而是离顶端有一定距离。

先看看我实现的方法例子: 在线地址:锚点偏移实例(强烈建议用firefox浏览器查看)

这实际上是一种掩眼法,对齐的参考点还是在元素的顶端,只是我把元素的设置了特定的border-top(padding-top也可以,margin-top不可以),锚点就可以好像真的一样偏移到目标标题文字,但是这样会使下来元素之间产生一段距离,那么我们只要设置其margin-top为负值,而且刚好为padding-top的值即可。但是还会产生一个问题,margin-top为负数值时,会强行把元素的p...

......[ More Detail ]

我的在线简历第000000001版

很快就要找工作了,最近比较闲,于是把写了个在线网页版简历。水平有限,肯定不少错误。希望高人可以指出错误。

此简历基于XHTML1.0/Css2.0/Mootools 我不能像大大们那样用纯js写效果,只能用mootools来写了。 极端希望大家给点意见,我发现自己好像很多自己总结的知识不一定对的。有兴趣的朋友可以留言索取整个实例源码。 在线测试地址:http://xiebiji.com/works/resume/

......[ More Detail ]

兼容ie6,ie7,ff的fixed,元素上下端固定定位方法

效果地址:点击我

为了兼容ie6(万恶的东西),用的是expression的方法

在页头加入:

body{ background-image:url(about:blank); background-attachment:fixed;/*必要,防抖动*/ } .head,.foot{ position:fixed !important;/*ie7 ff*/ position:absolute; z-index:21; background:#999; height:30px; width:500px; } .foot{ bottom:0 !important;/*ie7 ff*/ } .main{ height:2000px; }

HTML:

header main main main main main main main main main main main main main main main main main main main main main main main main main main main main main main main main main main main main foot

转载的同学麻烦注明一下出处:http://xiebiji.com/2009/09/fixed

......[ More Detail ]

[转]div+css多浏览器兼容的几个技巧

网上看到的一篇实用文章,阐述的兼容技巧。出处不知道是哪里的,要是原作者看见了,请留言说明吧^_^!如有侵犯我可立即撤下。

firefox不能对innerText支持 firefox支持innerHTML但却不支持innerText,它支持textContent来实现innerText,不过默认把多余的空格也保留了。如果不用textContent,如果字符串里面不包含HTML代码也可以用innerHTML代替。

禁止选取网页内容 在IE中一般用js:obj.onselectstart=function(){return false;} 而firefox用CSS:-moz-user-select:none

滤镜的支持(例:透明滤镜) IE:filter:alpha(opacity=10); firefox:-moz-opacity:.10;

捕获事件 IE:obj.setCapture() 、obj.releaseCapture() Firefox:document.addEventListener(”mousemove”,mousemovefunction,true); document.removeEventListener(”mousemove”,mousemovefunction,true);

...
......[ More Detail ]