保护眼睛,开启浏览器的夜间模式 顺便学下!important的作用
2013-07-30 15:15
357 查看
打开笔记本程序,复制以下代码
*{background-image: none !important; background: none !important; background:#333333 !important; color:#888888!important; border-color:#555555 !important; scrollbar-arrow-color:#CCCCCC !important; scrollbar-base-color:#2266AA !important; scrollbar-shadow-color:#2266AA !important; scrollbar-face-color:#333333 !important; scrollbar-highlight-color:#2266AA !important; scrollbar-dark-shadow-color:#2266AA !important; scrollbar-3d-light-color:#2266AA !important; scrollbar-track-color:#333333 !important;} a,a *{color:#88AADD !important; text-decoration:none !important;} a:visited,a:visited *,a:active,a:active *{color:#5588AA !important;} a:hover,a:hover *{color:#AADD88 !important; background:#666666 !important;}input,select,option,button,textarea{color:#AAAAAA !important; background:#555555 !important; border:#666666 !important; border-color: #666666 #888888 #888888 #666666 !important;}input:focus,select:focus,option:focus,button:focus,textarea:focus,input:hover, select:hover,option:hover,button:hover,textarea:hover {color:#BBBBBB !important; background:#5A5A5A !important; border-color: #777777 #999999 #999999 #777777 !important;} input[type=button],input[type=submit],input[type=reset],input[type=image] {border-color: #888888 #666666 #666666 #888888 !important;}input[type=button]:focus, input[type=submit]:focus,input[type=reset]:focus,input[type=image]:focus, input[type=button]:hover,input[type=submit]:hover,input[type=reset]:hover,input[type=image]:hover { color:#BBBBBB !important; background:#666666 !important; border-color: #AAAAAA #888888 #888888 #AAAAAA !important;}
文件→另存为 文件名输入 黑色.css,保存类型选择“所有文件”→保存。
打开internet选项,点击“辅助功能”,使用用户样式表→浏览刚才保存的css文件位置并选择,点确定即可。
下面是操作过程:
有图片为证哦。
步骤一:在浏览器中,找到“工具”->“Internet选项”
#box { width:150px; //这个是错误的width,所有浏览器都读到了 voice-family: \}\; //IE5.X/win忽略了\}\后的内容 voice-family:inherit; width:100px; //包括IE6/win在内的部分浏览器读到这句,新的数值(300px)覆盖掉了旧的 } 还有更简单的办法如下: CSS: #box { width:150px; } #box div { border:5px; padding:20px; } HTML: ...
View Code
这样一来在任何浏览器中盒的总宽度都将是150像素。
但是即使是到了最新的IE6.0依然存在浮动模型(Float-model)的问题,值得庆幸(还是悲哀?)的是我们可以用IE中一直都不支持的!important来解决这个问题。
!important是CSS1就定义的语法,作用是提高指定样式规则的应用优先权(参见:W3.org的解释)。语法格式{ sRule!important },即写在定义的最后面,
例如:
box{color:red !important;}
假如我们定义一个这样的样式:
#box{background-color: #ffffff !important; background-color: #000000;}
那么在支持该语法的浏览器,如Firefox、Opera中,能够理解!important的优先级,背景显示#ffffff颜色,而在IE中则显示#000000.
相关文章推荐
- Linux写代码的夜间模式(保护眼睛),在Linux中安装f.lux
- 保护眼睛的Windows、PDF和IE、Firefox、谷歌等浏览器颜色设置
- 保护眼睛的Windows和IE、Firefox、谷歌等浏览器颜色设置
- 开启 Chromebook 的夜间模式
- 实模式切换到保护模式,为什么要开启A20地址线(系统升级产生的兼容性问题)
- 利用html开启国产浏览器的高速模式
- JavaScript开启浏览器全屏模式
- 实模式切换到保护模式,为什么要开启A20地址线(系统升级产生的兼容性问题)
- Win10 10074预览版怎么开启夜间模式?
- Doctype的作用以及浏览器的严格模式和混杂模式的区别
- 段寄存器在实模式下和保护模式下的作用有什么不同
- 如何开启浏览器的Private浏览模式
- 将窗口和浏览器背景色改为豆沙色保护眼睛
- 二、进入保护模式--内核加载器LOADER:实模式下内存容量检测、开启保护模式、开启分页模式、加载kernel到内存缓冲区、加载kernel到内存(内存复制函数)->kernel
- 教你配置浏览器的苹果绿背景-保护您的眼睛
- 360浏览器怎么开启夜间模式
- android 浏览器夜间模式
- [转]保护眼睛的Windows和IE、Firefox、谷歌等浏览器颜色设置
- IE11/Flash页游白屏怎么办!立刻开启IE大地址模式!缓解浏览器白屏问题
- 智能手机可设置适合眼睛的夜间模式