占位符文本格式

时间:2012-03-02 19:04:53

标签: html css

我有以下代码。

<input class="domain" id="Domain" name="Domain" placeholder="Domain" required="required" type="text" value="" />

我试图格式化占位符文本,因为它在文本框中显得非常小,我将如何进行此操作?

3 个答案:

答案 0 :(得分:11)

在你的css中试试这个

/*For Webkit browsers (Chrome, Safari) */

input::-webkit-input-placeholder {
   /* Your style here e.g. font size, color etc */
}

/* For Mozilla Firefox */

input:-moz-placeholder {
    /* Your style here e.g. font size, color etc */
}

答案 1 :(得分:3)

包括IE在内的@Ilja答案将是:

/* For IE browser */
input:-ms-input-placeholder {
   /* Your style here e.g. font size, color etc */
}

/*For Webkit browsers (Chrome, Safari) */
input::-webkit-input-placeholder {
   /* Your style here e.g. font size, color etc */
}

/* For Mozilla Firefox */
input:-moz-placeholder {
    /* Your style here e.g. font size, color etc */
}

答案 2 :(得分:0)

如何将类域的字体大小增加到一些清晰的字体大小?

.domain
{
  font-size : 14px;
}