cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos

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!

Accepted Solutions (1)

Accepted Solutions (1)

former_member227918
Active Contributor

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

0 Kudos

That worked really fine! Thank you very much!

Answers (0)