常用css总结
2024-09-25 22:01:00
个人博客:
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:未完待续~
最新文章
- 关于ubuntukylin安装后界面中英文混杂的问题
- 20160620001 FileUpload控件获取上传文件的路径
- android获取string.xml的值(转)
- MySQL内置函数
- perl DBI 学习总结(转载)
- 关于BP算法在DNN中本质问题的几点随笔 [原创 by 白明] 微信号matthew-bai
- MediaPlayer中创建AudioTrack的过程
- 发布Ubuntu/Linux系统cache,增加可用内存空间
- RobotFramework自动化测试框架-常用断言关键字
- iOS开源照片浏览器框架SGPhotoBrowser的设计与实现
- android 优化之布局优化
- 利用XShell上传、下载文件(使用sz与rz命令)
- CSS---光标cursor设置、浮动布局与clear的关系
- tomcat部署公共jar包
- Docker和jenkins实现springboot自动部署
- Nginx map模块
- php const常量 不能使用字符串连接符.链接
- Access restriction: The type &#39;Unsafe&#39; is not API
- C语言函数参数传递
- 第三方包jintellitype实现Java设置全局热键
热门文章
- 树形dp poj2342 Anniversary party * 求最大价值
- JavaScript数组方法速查,32个数组的常用方法和属性
- Java Web第一个应用搭建
- Could not calculate build plan :lugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of
- 错误:java.lang.Exception: No tests found matching Method testPrePage1(egou_manager_web.TestEBrand) from org.junit.internal.requests.ClassRequest@4f3cc73c
- The 10 Most Important Linux Commands/10个最经常使用的命令行
- Flink cep的初步使用
- java反射机制,以及对反射机制的了解
- Java中对象创建时的内存分配
- 解决微信小程序开发中wxss中不能用本地图片