原文来自:snippets.barretlee.com,只是为了自己学习收集特意fork了一遍。如有侵权,联系删除:i@webcliwn.net。1
2
3
4
5
6
7
8
9
10ErrorDocument 400 /400.html
ErrorDocument 401 /401.html
ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
ErrorDocument 405 /405.html
ErrorDocument 408 /408.html
ErrorDocument 414 /414.html
ErrorDocument 500 /500.html
ErrorDocument 502 /502.html
ErrorDocument 504 /504.html
自动添加文件
原文来自:snippets.barretlee.com,只是为了自己学习收集特意fork了一遍。如有侵权,联系删除:i@webcliwn.net。1
2php_value auto_prepend_file "/real/path/to/file/functions.php"
php_value auto_append_file "/real/path/to/file/footer.php"
301跳转
原文来自:snippets.barretlee.com,只是为了自己学习收集特意fork了一遍。如有侵权,联系删除:i@webcliwn.net。
单页面:
1 | Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html |
整站:
1 | Redirect 301 / http://newsite.com/ |
重写 file 控件样式
原文来自:snippets.barretlee.com,只是为了自己学习收集特意fork了一遍。如有侵权,联系删除:i@webcliwn.net。
演示:
1 | input[type="file"]{ |
CSS样式技巧
原文来自:snippets.barretlee.com,只是为了自己学习收集特意fork了一遍。如有侵权,联系删除:i@webcliwn.net。
1、禁止ios和android用户选中文字
1 | .css{-webkit-user-select:none} |
2、禁止ios长按时触发系统的菜单,禁止ios&android长按时下载图片
1 | .css{-webkit-touch-callout: none} |
3、webkit去除表单元素的默认样式
1 | .css{-webkit-appearance:none;} |
4、修改webkit表单输入框placeholder的样式
1 | input::-webkit-input-placeholder{color:#AAAAAA;} |
5、去除android a/button/input标签被点击时产生的边框 & 去除ios a标签被点击时产生的半透明灰色背景
1 | a,button,input{-webkit-tap-highlight-color:rgba(255,0,0,0);} |
6、ios使用-webkit-text-size-adjust禁止调整字体大小
1 | body{-webkit-text-size-adjust: 100%!important;} |
7、android 上去掉语音输入按钮
1 | input::-webkit-input-speech-button {display: none} |
8、移动端定义字体,移动端没有微软雅黑字体
1 | /* 移动端定义字体的代码 */ |
css颤动效果
原文来自:snippets.barretlee.com,只是为了自己学习收集特意fork了一遍。如有侵权,联系删除:i@webcliwn.net。
演示:
Hover Me
1 | .face:hover { |
reset.css
原文来自:snippets.barretlee.com,只是为了自己学习收集特意fork了一遍。如有侵权,联系删除:i@webcliwn.net。1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
body {
line-height: 1;
color: black;
background: white;
}
ol, ul {
list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
placeholder文字居中
原文来自:snippets.barretlee.com,只是为了自己学习收集特意fork了一遍。如有侵权,联系删除:i@webcliwn.net。
Author: 吕大豹
Email: 670818517(at)qq.com
让placeholder居中的兼容写法:
1 | input::input-placeholder { text-align: center } |
如果是 textarea 也同理:textarea::input-placeholder
,同时配合line-height,还能实现文字的垂直居中
透明度
原文来自:snippets.barretlee.com,只是为了自己学习收集特意fork了一遍。如有侵权,联系删除:i@webcliwn.net。1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16.transparent_class {
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* IE 5-7 */
filter: alpha(opacity=50);
/* Netscape */
-moz-opacity: 0.5;
/* Safari 1.x */
-khtml-opacity: 0.5;
/* Good browsers */
opacity: 0.5;
}
转屏media
原文来自:snippets.barretlee.com,只是为了自己学习收集特意fork了一遍。如有侵权,联系删除:i@webcliwn.net。1
2<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css">
<link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.css">