Nikitc
Nikitc

Reputation: 55

Character at the end in the INPUT

I want to do it as well as in this example in HTML and put the character at the end of the input field. How to do it? Thank you.

inputfield with character

Upvotes: 2

Views: 1069

Answers (2)

L L
L L

Reputation: 1470

Here, a working example using position relative:

.required{
  position:relative;
  right:15px;
  top: 3px;
  color:red;
}
<input type="text" placeholder="John Doe" name="full_name"><span class="required">*</span>

Upvotes: 6

AVI
AVI

Reputation: 5703

This would be better and easy

.star {
  display: block;
  color: red;
  margin: -20px 185px;
}
<input style="width:200px">
<span class="star">*</span>

Upvotes: 2

Related Questions