Tag Archive for 'HTML'

最完整Html符号大全

Html符号大全

Css样式兼容IE6,IE7,FIREFOX的写法

根据FF和IE对一些符号识别的差异,我们可以单独对FF以及IE定义样式,例子:

区别IE6与FF:

1
background:orange;*background:blue;

区别IE6与IE7:

1
background:green !important;background:blue;

区别IE7与FF:

1
background:orange; *background:green;

区别FF,IE7,IE6:

1
background:orange;*background:green !important;*background:blue;

注:IE都能识别*;标准浏览器(如FF)不能识别*;

  • IE6能识别*,但不能识别 !important,
  • IE7能识别*,也能识别!important;
  • FF不能识别*,但能识别!important;

所以标准的写法FF,IE7,IE6:

1
color:#fff; *color:#000 !important; *color:#ff6600;

firefox:白色,IE7:黑色,IE6:橙色

另外再补充一个,下划线”_”,
IE6支持下划线,IE7和firefox均不支持下划线。

于是大家还可以这样来区分IE6,IE7,firefox:

1
background:orange;*background:green;_background:blue;

注:不管是什么方法,书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在最后面。
Continue reading ‘Css样式兼容IE6,IE7,FIREFOX的写法’

点击浏览器的后退按钮后表单内容的控制

为什么我在点击浏览器的后退按钮后,所有字段的信息都被清空了?

这是由于在表单提交页面中使用了 session_start 函数。该函数会强制当前页面不被缓存。解决办法为,在你的 session_start 函数后加入

1
header("Cache-control: private");

注意在本行之前你的PHP程序不能有任何输出。

还有基于 session 的解决方法,在 session_start 前加上

1
2
3
session_cache_limiter('nocache'); // 清空表单
session_cache_limiter('private');  //不清空表单,只在session生效期间
session_cache_limiter('public');  //不清空表单,如同没使用session一般