问题
I am making a website for a client of me but im running into a problem. I've made a contact form in wordpress using Contact Form 7. This plugin is really easy to use but when i wanted to use the placeholder property of the plugin it did not show the placeholder when i loaded the page.
This is how i set the placeholder in Contactform 7
[text* your-name placeholder "Name"]
The placeholder tag works just fine for my textarea but it doesnt work with the textbox above. Can someone explain to me what i am doeing wrong here?
EDIT
When i inspect the element with Google Chrome and inspect the textbox it says that it has a placeholder. But it doesnt show the placeholder.
回答1:
If anyone is having trouble with this, it could be that you're using class: or id: attributes.
It worked for me when I added placeholder after all those:
[email* your-email id:your-email class:form-control placeholder "ex. Jon.Smith@email.com"]
回答2:
Same problem, then I change the input background color and the placeholder text is white on background white ...
So I sudgest to try to change the backrgound input color to test:
input[type="text"], textarea {
background-color : #d1d1d1;
}
回答3:
Its very simple.You can add placeholder like this:
[text* first_name placeholder"First Name"]
Documentation : https://contactform7.com/setting-placeholder-text/
回答4:
[text* your-name placeholder "Name"] The syntax was what you gave correct once check the contact form settings. Because I am also using same as like your syntax it was working properly in my contact form.
回答5:
If you are using class or id attributes.Simply do the following:
[text* your-name class:form-control id:name placeholder "Enter Name"]
来源:https://stackoverflow.com/questions/24309750/placeholder-in-contactform-7-wordpress