没有样式就是最好的样式

Archive for March, 2005


改变网页字体大小的bookmarklet

Mar 31, 2005 Author: | Filed under: Uncategorized

很奇怪,见到 ctrl + - 不能控制的页面,找了一下原因,没找到。做个 bookmarklet,修改中,目前不能对老式的 table 布局页面处理…

如果是 12px 的字体,IE不能控制大小,IE 下使用说明在此

某些页面在 firefox 下也不通过 ctrl+- 或者 ctrl+鼠标滚轮 来控制字体大小,firefox 下使用说明在此


点击这里打开新窗口浏览此网页

源代码如下:

显示更多

下面是 styleSheets 对象测试

显示更多

[Edit on 2005-3-31 15:11:04 By guoshuang]

css 技巧 II

Mar 25, 2005 Author: | Filed under: Uncategorized

看到 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 的部分,大多是一些入门的东西,有兴趣可以看看。

[Edit on 2005-3-25 10:11:11 By guoshuang]

firefox 加入收藏代码的另一种方式 rel=sidebar

Mar 25, 2005 Author: | Filed under: Uncategorized

在 firefox 中文论坛看到的

测试firefox 收藏

firefox 怎么拿 option.text 当 value 呢?

Mar 23, 2005 Author: | Filed under: Uncategorized

IE 没有此问题。

运行代码 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

用 getAttribute() 得到正确结果。不知道这算不算 firefox bug。

运行代码 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

IE 得到的是 “” 空字符串;firefox 得到的是 null,真是无所适从…

另外,firefox 对 style=”display:none;” 的处理似乎也与IE不同,这样包住的