很奇怪,见到 ctrl + - 不能控制的页面,找了一下原因,没找到。做个 bookmarklet,修改中,目前不能对老式的 table 布局页面处理…
如果是 12px 的字体,IE不能控制大小,IE 下使用说明在此
某些页面在 firefox 下也不通过 ctrl+- 或者 ctrl+鼠标滚轮 来控制字体大小,firefox 下使用说明在此
源代码如下:
javascript:javascript:if(document.body.currentStyle){oSize=document.body.currentStyle.fontSize;oUnit=oSize.replace(/d/g,”");oNum=parseInt(oSize.replace(/D/g,”"))+1;oStyle=”font-size:”+oNum+oUnit;void(document.body.style.cssText=oStyle);}if(document.defaultView){oSize=document.defaultView.getComputedStyle(document.body,null).getPropertyValue(’font-size’);oNum=parseInt(oSize.replace(/D/g,”"))+1;oStyle=”font-size:”+oNum+”px”;void(document.body.style.cssText=oStyle);}
下面是 styleSheets 对象测试
javascript:if(document.styleSheets[0].insertRule){void(document.styleSheets[0].insertRule(”* {font-size:60px !important}”,0))}if(document.styleSheets[0].addRule){void(document.styleSheets[0].addRule(”*”,”{font-size:60px !important}”,0))}
看到 CSS tips and tricks, Part 2,仅列出我感兴趣的部分。
a 链接样式声明的正确顺序
:link :visited :hover :active.
:focus 与 :hover 之间,位置后面的优先,这取决你你想要的效果。
css browser hack
这个大家都知道了,IE 不认识 > 选择器,用来屏蔽IE。
html>body p {
/* 样式表声明内容 */
}
这个倒是第一次听说,IE认识,其他浏览器不认识。
* html p {
/* 样式表声明内容 */
}
给IE看但 MAC IE 不认识。注释加 的hack 语法
Sometimes you want to feed some CSS to IE/Win but not IE/Mac. To do this you can use the commented backslash hack:
/* */
html p {
declarations
}
/* */
很老的方法,IE特有的 条件注释判断( conditional comments)
CSS盒子(Box)模型大小问题
outline 是个好东西,不占空间,可惜支持的浏览器太少(opera可以)。
这是 技巧1 的部分,大多是一些入门的东西,有兴趣可以看看。
在 firefox 中文论坛看到的
IE 没有此问题。
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
用 getAttribute() 得到正确结果。不知道这算不算 firefox bug。
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
IE 得到的是 “” 空字符串;firefox 得到的是 null,真是无所适从…
另外,firefox 对 style=”display:none;” 的处理似乎也与IE不同,这样包住的