The placeholder attribute specifies a short hint that describes the expected value of a input field / textarea. The short hint is displayed in the field before the user enters a value. In most of the browsers, placeholder texts are usually aligned in left. The selector uses text-align property to set the text alignment in the placeholder.
This selector can change browser to browser. For example:
- For Chrome, Mozilla, and Opera Browsers:
- For Internet Explorer:
Example 1: This example describes only placeholder alignment, it does not align placeholder value.
Example 2: This example describes the placeholder and placeholder value align.