Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use placeholder to beautify input background prompt text in HTML5

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "how to use placeholder to beautify input background tips in HTML5", so the editor summarizes the following content, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use placeholder to beautify input background tips in HTML5" article.

CSS code

The way it is written in Firefox is a little different from that in Google browser and Safari, but I believe it will be unified in the future.

/ * General * /::-webkit-input-placeholder {color:#f00;}::-moz-placeholder {color:#f00;} / * firefox 19 + * /:-ms-input-placeholder {color:#f00;} / * ie * / input:-moz-placeholder {color:#f00;} / * webkit exclusive * / # field2::-webkit-input-placeholder {color:#00f;} # field3::-webkit-input-placeholder {color:#090; background:lightgreen; text-transform:uppercase } # field4::-webkit-input-placeholder {font-style:italic; text-decoration:overline; letter-spacing:3px; color:#999;} / * mozilla exclusive * / # field2::-moz-placeholder {color:#00f;} # field3::-moz-placeholder {color:#090; background:lightgreen; text-transform:uppercase;} # field4::-moz-placeholder {font-style:italic; text-decoration:overline; letter-spacing:3px; color:#999;}

It's just a line of code, but in order to achieve the widest range of browser support, add their respective browser engine prefixes (Vendor Prefix), and suddenly become more than 10 lines of code. I hope this situation will pass as soon as possible.

You can use some basic CSS styles on placeholder-colors, fonts, font styles, etc. You can also create more complex styles, such as GIF animation.

The above is about the content of this article on "how to beautify the background prompt text of input with placeholder in HTML5". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more related knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report