Skip to Content

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

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!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 30, 2017 at 09:57 AM

    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

    Add comment
    10|10000 characters needed characters exceeded