Skip to Content
0

Setting the font size of the placeholder in an input field [CSS]

Aug 30, 2017 at 09:23 AM

21

avatar image

Hello together,

a little hopefully easy to resolve css styling question.

I want every placeholder for the ".sapMInputBaseInner" class to have a smaller font-size than default. My plan was to overwrite the class like this

.sapMInputBaseInner[placeholder]{
    font-size: 10px;
}

But that doesn't work. If I'm just trying to change to font-size of the placeholder for a specific input field, it also doesn't work.

.myInputField[placeholder]{
    font-size: 10px;
}

Any ideas why?

Thanks in advance!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Akhilesh Upadhyay Aug 30, 2017 at 09:57 AM
1

Hi, check below if it helps,

for all input,

input.sapMInputBaseInner::placeholder {
    color: red !important;
    font-size: 10px;
} 
OR
.sapMInputBaseInner::placeholder {
    color: red !important;
    font-size: 10px;
}

For particular input,

#idInput::placeholder { color: red !important; font-size: 10px; }

-Akhilesh

Show 1 Share
10 |10000 characters needed characters left characters exceeded

That worked really fine! Thank you very much!

0