Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.9k views
in Q2A Core by

How to set placeholder for the username field on register page like the screenshot below?

It would be good if I can change the css of the placeholder as well.

Q2A version: 1.6.3

1 Answer

+5 votes
by
selected by
 
Best answer

Here you need to do the code change 

see this line 

https://github.com/q2a/question2answer/blob/master/qa-include/pages/register.php#L153

'tags' => 'name="handle" id="handle"',

Change to ===>>>

'tags' => 'name="handle" id="handle" placeholder="Please use your first name + last name "',

-----------UPDATE ----------

To convert the placeholder style to red , use the following css code inside qa-styles.css file 

::-webkit-input-placeholder {
   color: red;
}
 
:-moz-placeholder { 
   color: red;  
}
 
::-moz-placeholder {  
   color: red;  
}
 
:-ms-input-placeholder {  
   color: red;  
}
 

--------------------------UPDATE - -------------

if you want only to change the redcolor for only the usename , just use the CSS selector . it should work 

 

#handle::-webkit-input-placeholder {
    color: red;
}

#handle:-moz-placeholder {
    color: red;
}

#handle::-moz-placeholder {
    color: red;
}

#handle:-ms-input-placeholder {
    color: red;
}
by
and how to change the color to red?
by
Please see my updated answer . Thanks
by
Using your recent css, all placeholder on entire site will be in red. I want just the username' placeholder in red.
by
Ok . I updated again my answer .
by
Thanks Ami. It works.
...