The placeholder property is added for input in HTML5. Provides a placeholder on input that displays the prompt information for the expected value of the input field (hint), which is displayed when the input is empty.Such asThe current browser support situation
Browser
Ie6/7/8/9
ie10+
Firefox
Chrome
Safari
is supported
NO
YES
YES
YES
Placeholder is the HTML5 form characteristics of the more useful one, but suffer from its backward compatibility, so generally to do backward-compatible sites are not afraid to use, if useful to the place, is also a simple simulation with JS to achieve, then there is no one to solve the problem once and for all?And then I'm going to take you to this program:if inch return;This code means to determine whether the p
Original link: http://www.cnblogs.com/yjzhu/p/4398835.htmlPlaceholder is a newly added property of HTML5 that provides a hint (hint) that describes the values expected by the input fields. The hint appears when the input field is empty and disappears when the field gets focus. The placeholder property applies to the following types of input tags: text, search, URL, telephone, email, and password.Let's look at the effect in Google Chrome first:When you
Input::input-placeholder{color: #bdbdbd;}/* Some data display needs to be written, some display do not need, but in the editor webstorm the property is not recognized */::- Webkit-input-placeholder {/* webkit browsers * * color: #999;}:-moz-placeholder {/* Mozilla Firefox 4 to * * * Color: #999; }::-moz-placeholder {/*
Input::input-placeholder{Color:#bdbdbd;}/*Some of the information is required to be written, some are not required, but the property is not recognized in editor Webstorm*/::-webkit-input-placeholder{/*WebKit Browsers*/Color:#999; }:-moz-placeholder{/*Mozilla Firefox 4 to*/Color:#999; }::-moz-placeholder{/*Mozilla Firef
We sometimes need to customize the style of the Uitextfield object, and can add many different rewriting methods to change the display behavior of the text field. All of these methods return a CGRECT structure, set the boundary range for each part of the text field, and even modify the placeholder color, font.–textrectforbounds://rewrite to reset text area–drawtextinrect://Change the Emoji property. When overridden, calling super can be drawn by defau
this article reprinted to http://m.blog.csdn.net/blog/a394318511/8025170We sometimes need to customize the style of the Uitextfield object, and can add many different rewriting methods to change the display behavior of the text field. All of these methods return a CGRECT structure, set the boundary range for each part of the text field, and even modify the placeholder color, font.–textrectforbounds://rewrite to reset text area–drawtextinrect://Change
Original link: http://www.w3school.com.cn/html5/att_input_placeholder.aspHTML 5 HTML 5 InstanceSearch field with placeholder text:placeholder="Search W3School" /> Try it yourself.Definition and usageThe placeholder property provides a hint that describes the expected value of an input field (hint).The hint appears when the input field is empty and disappears when the field gets focus.Note: The
Change the color and font of uitextfield placeholder
Sometimes we need to customize the uitextfield object style. We can add many different rewriting methods to change the display behavior of text fields. These methods return a cgrect structure, define the boundary range of each part of the text field, and even modify the placeholder color and font.
-Textrectforbounds: // rewrite to reset the text area
-D
In fact, in addition to the browser supporting placeholder, other implementations using JS or JQ are not called placeholder effects and can only be regarded as the focus, or a placeholder that loses focus has an effect when it is not born.
Many people use JQ to write. The author uses js to write
In this case, I think using JS or JQ is not only a matter of gains a
1. The form often appears prompt text, placeholder is the most commonly used one way, the following to explain how to set the style of placeholder ::-webkit-input-placeholder{color:red; padding:5px; } :-moz-placeholder{color:red;padding:5px; } ::-moz-placeholder{color:re
In doing the project, especially for login, registration of some important tips, are generally using the placeholder attribute, you can realize the input when the message disappears, lost focus after the message display, but this attribute is not compatible;
The following code can attempt to use jquery to complete a placeholder.
Note: The Password box needs to be handled separately, and the text style in
Tags: upd input desc Library put-in table string 3.x optionalThe sqlite3 module supports the kinds of placeholders:question marks (Qmark style) and named placeholders (named Style).execute(SQL[, parameters]) The Sqlite3 module supports two placeholders:? placeholders and well-known placeholder characters.But in use? placeholder, be aware that when you pass in a parameter and the argument is a string, you c
The new placeholder attribute of the text box in HTML5 is a very useful attribute, but it is not supported by the IE series until IE9, which makes everyone hesitate when using this attribute. I have written many similar widgets, but none of them are very common. Here I will share a jQuery plug-in with a progressive enhancement of the custom placeholder. It is easy to use. You can also make improvements base
Native TextView no placeholder text, can be DrawRect: method to add placeholder text, the specific settings are as follows:1. Get the current placeholder Text property:// Text Properties Nsmutabledictionary *attrs =// Gets the Text property of the current Placeholdertextview attrs[ Nsforegroundcolorattributename] = Self.placeholdercolor? Self.placeholdercolor: [
Implement placeholder and UITextView of uitextview
We know that during iOS development, the UITextField control has a placeholder attribute. The usage of UITextField is similar to that of UITextView. There are two differences: 1. UITextField single row input, while UITextView can be multiple rows input. 2. UITextField has the placeholder attribute, but UITextView
We know that in iOS development, the control Uitextfield has a placeholder property, Uitextfield and Uitextview use the method basically similar, there are two small differences: 1. Uitextfield single-line input, while Uitextview can enter multiple lines. 2.UITextField has a placeholder attribute, and Uitextview does not. As for the two agent method, the principle is basically similar, but the method name s
The following JS file is referenced in HTML and is written in the style file: Input,textarea{color: #999;} Input:focus,textarea:focus{color: #333;}I am simply using the global style to write this, if you do not want all input boxes are prompted, you can give the required input specific classes, such as:. txt{color: #999;} . Txt:focus{color: #333;}(function ($) {/** * Spoofs placeholders in browsers this don ' t support them (eg Firefox 3) * * Copyright (Dan Bentley) * License D under the Apache
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.