1

I want to move my placeholder in upper-left corner.

enter image description here

I want something like on the image.

I've tried

::-webkit-input-placeholder {
    left: 0px;
    up: 0px;
}

But it doesn't work. I know HTML well, but I never did something like this.

j08691
  • 197,815
  • 30
  • 248
  • 265
Stefan Đorđević
  • 514
  • 1
  • 3
  • 21

4 Answers4

3

I've found answer by myself! :D

So, I just changed <input> to <textarea>. With a little CSS it looks completely same as input field.

Very much thanks for everyone who tried to help me!

Stefan Đorđević
  • 514
  • 1
  • 3
  • 21
0

You can only use text-align: center|left|right to change the align of the input's value/placeholder.

source: https://developer.mozilla.org/de/docs/Web/CSS/text-align

Otherwise you could use padding: 0 0 0 0; to force space

source: https://developer.mozilla.org/de/docs/Web/CSS/padding

Information: up isn't valid css. the right name is top And if you want to use position attributes like: right, left, bottom or top you have to set position: absolute|fixed;

Edit: As told in here: https://stackoverflow.com/a/5677243/3119231 it is possible to set "top" value through line-height attribute

Community
  • 1
  • 1
0

I think css positioning can help. position relative or absolute. According to your container, try to give one of position styles.

EDIT: or you can use background-image instead of placeholder. and you can remove background image on mouse over with javascript.

oneNiceFriend
  • 6,411
  • 7
  • 28
  • 38
0

Unfortunately, you are limited to what styling can be applied to the placeholder pseudo-element.

Article

These are:

  • color
  • font-size / font-style / font-weight
  • letter-spacing
  • line-height
  • padding
  • text-align
  • text-decoration

Position is not one of them.

Paulie_D
  • 102,164
  • 10
  • 117
  • 144