在IE中更改占位符文本的字体大小和边距 [英] Changing Font Size and Margin of Placeholder Text in IE

查看:218
本文介绍了在IE中更改占位符文本的字体大小和边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有某个占位符的文本输入:

I have a text input with some placeholder:

<input type="text" placeholder="placeholder"/>

我想让占位符文本小于输入的文本:

I would like to make the placeholder text smaller than the input's text:

input {
    font-size: 20px;
}
input:-ms-input-placeholder{
    font-size:5px;
}
input::-webkit-input-placeholder {
    font-size:5px;
}

这在Chrome中工作得很好,但是IE会缩小整个输入框显示文本。然后当我点击键入时展开框。这是一个小提琴: http://jsfiddle.net/Brn6h/3/

This works well in Chrome, but IE shrinks the whole input box when the placeholder text is displayed. It then expands the box when I click to type. Here's a fiddle: http://jsfiddle.net/Brn6h/3/

如何使输入框在IE中保持相同的大小?

How do I make the input box stay the same size in IE?

推荐答案

input {
        font-size: 20px;
        height: 20px;
        width: 200px;
    }

JSFiddle

JSFiddle

这篇关于在IE中更改占位符文本的字体大小和边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆