I want to use text stroke in <input type="text"/> and I need it to be cross-browser (firefox, google chrome, safari, opera, IE7+).
Is any there any method to do it (CSS 2.1, jQuery…)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I believe he’s speaking about the css property text-stroke (
-webkit-text-stroke). This is only properly supported in webkit browsers, so no proper implementation can occur in, for instance, Internet Explorer. However, you can kind of fake it withtext-shadowwhich can work in ie7+. if you MUST have it in ie. See http://css-tricks.com/adding-stroke-to-web-text/It would look something like:
or for inline:
The only real drawback of this approach is that the shadow can only be 1px or it starts to look funny, so it’s not a perfect replication of
text-stroke. That said, you might want to look into conditional css, where browsers that support it use text-stroke, and others use this hacky approach.