html,css 如何设置input的placeholder样式
侧边栏壁纸
  • 累计撰写 635 篇文章
  • 累计收到 0 条评论

html,css 如何设置input的placeholder样式

加速器之家
2024-08-22 / 0 评论 / 3 阅读 / 正在检测是否收录...

html,css 如何设置input的placeholder样式,在做前端开发时,如果想写对input设置字体,文字大小,颜色等,我们该如何设置呢?

通过如下设置兼容主流浏览器:

-webkit-input-placeholder /* WebKit browsers */

input::-moz-placeholder /* Mozilla Firefox 19+ */

input::-ms-input-placeholder /* Internet Explorer 10+ */

以下是个简单的例子,对input设置字体颜色和字体大小,如果需要其他的样式,加入即可。

.rj_zyyform input::-webkit-input-placeholder { /* WebKit browsers */
  color: #7f7f7f;
  font-size: 0.96rem;
}

.rj_zyyform  input::-moz-placeholder { /* Mozilla Firefox 19+ */
  color: #7f7f7f;
  font-size: 0.96rem;
}

.rj_zyyform input::-ms-input-placeholder { /* Internet Explorer 10+ */
  color: #7f7f7f;
  font-size: 0.96rem;
}


0

评论

博主关闭了当前页面的评论