在实际的web开发中,除了HTML和JavaScript,CSS也是很重要的一门技术。其中,输入法对于前端开发者来说也是非常重要的一部分。那么,CSS如何写出最多输入法呢?下面就是关于此的详细介绍。/...
在实际的web开发中,除了HTML和JavaScript,CSS也是很重要的一门技术。其中,输入法对于前端开发者来说也是非常重要的一部分。
那么,CSS如何写出最多输入法呢?下面就是关于此的详细介绍。
/* 1、使用 ::placeholder 伪元素 */
input[type="text"]::placeholder {
unicode-range: U+2E80-9FFF, U+FF00-FFEF, U+2000-206F, U+3000-303F;
}
/* 2、使用 text-indent 属性 */
input[type="text"] {
text-indent: -9999px;
font-size: 16px;
line-height: 16px;
}
input[type="text"]::before {
content: "";
display: inline-block;
vertical-align: middle;
width: 0;
height: 100%;
}
input[type="text"]::-moz-placeholder {
unicode-range: U+2E80-9FFF, U+FF00-FFEF, U+2000-206F, U+3000-303F;
color: transparent;
}
/* 3、使用 font-family 属性 */
input[type="text"] {
font-family: "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
/* 4、使用 unicode-range 属性 */
input[type="text"] {
font-family: sans-serif;
unicode-range: U+2E80-9FFF, U+FF00-FFEF, U+2000-206F, U+3000-303F;
}
/* 5、使用自定义字体文件 */
@font-face {
font-family: 'custom_font';
src: url('custom_font.ttf');
unicode-range: U+2E80-9FFF, U+FF00-FFEF, U+2000-206F, U+3000-303F;
}
input[type="text"] {
font-family: 'custom_font', sans-serif;
} 以上就是使用CSS写最多输入法的方法,希望对大家有所帮助。