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
  • 204,283
  • 31
  • 260
  • 272
Stefan Đorđević
  • 565
  • 1
  • 4
  • 22

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ć
  • 565
  • 1
  • 4
  • 22
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,691
  • 7
  • 29
  • 39
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
  • 107,962
  • 13
  • 142
  • 161