个人博客:

https://chenjiahao.xyz


1、让网站快速变灰

 html {
filter: grayscale(100%);//IE浏览器
-webkit-filter: grayscale(100%);//谷歌浏览器
-moz-filter: grayscale(100%);//火狐
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
-webkit-filter: grayscale(1);//谷歌浏览器
}

2、让div如input般可编辑

 <div id="test" contentEditable="true"  ></div>  

 <div id="test1" contentEditable="true" ></div>  

  <div id="test2" contentEditable="true"></div> 

兼容性如下图:

3、让div禁止选择

 <div unselectable="on" onselectstart="return false;">
试试看能否选择
</div>

4、给placeholder设置属性

 ::-webkit-input-placeholder { /* WebKit browsers */
color: #999;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #999;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #999;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
color: #999;
}

5、清除浮动

 .clearfix:after{display:block;visibility:hidden;clear:both;height:;content:'.';font-size:}

6、文字溢出显示省略号

 {display:bolck;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}

7、强制换行

 //自动换行

 div{
word-wrap: break-word;
word-break: normal;
} //强制英文单词断行 div{
word-break:break-all;
} //强制不换行 div{
white-space:nowrap;
}

Ps:未完待续~

最新文章

  1. 关于ubuntukylin安装后界面中英文混杂的问题
  2. 20160620001 FileUpload控件获取上传文件的路径
  3. android获取string.xml的值(转)
  4. MySQL内置函数
  5. perl DBI 学习总结(转载)
  6. 关于BP算法在DNN中本质问题的几点随笔 [原创 by 白明] 微信号matthew-bai
  7. MediaPlayer中创建AudioTrack的过程
  8. 发布Ubuntu/Linux系统cache,增加可用内存空间
  9. RobotFramework自动化测试框架-常用断言关键字
  10. iOS开源照片浏览器框架SGPhotoBrowser的设计与实现
  11. android 优化之布局优化
  12. 利用XShell上传、下载文件(使用sz与rz命令)
  13. CSS---光标cursor设置、浮动布局与clear的关系
  14. tomcat部署公共jar包
  15. Docker和jenkins实现springboot自动部署
  16. Nginx map模块
  17. php const常量 不能使用字符串连接符.链接
  18. Access restriction: The type &#39;Unsafe&#39; is not API
  19. C语言函数参数传递
  20. 第三方包jintellitype实现Java设置全局热键

热门文章

  1. 树形dp poj2342 Anniversary party * 求最大价值
  2. JavaScript数组方法速查,32个数组的常用方法和属性
  3. Java Web第一个应用搭建
  4. Could not calculate build plan :lugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of
  5. 错误:java.lang.Exception: No tests found matching Method testPrePage1(egou_manager_web.TestEBrand) from org.junit.internal.requests.ClassRequest@4f3cc73c
  6. The 10 Most Important Linux Commands/10个最经常使用的命令行
  7. Flink cep的初步使用
  8. java反射机制,以及对反射机制的了解
  9. Java中对象创建时的内存分配
  10. 解决微信小程序开发中wxss中不能用本地图片