It is possible to have 2 different font sizes in one input placeholder in css? It is possible to have 2 different font sizes in one input placeholder in css? wordpress wordpress

It is possible to have 2 different font sizes in one input placeholder in css?


To apply different styles in the same placeholder is not possible.

What you can do however is either use pseudo elements or a div which behaves as a placeholder and hide/show it when the input is focussed.

This might help:

$("#input").keyup(function() {  if ($(this).val().length) {    $(this).next('.placeholder').hide();  } else {    $(this).next('.placeholder').show();  }});$(".placeholder").click(function() {  $(this).prev().focus();});
.placeholder {  position: absolute;  margin: 7px 8px;  color: #A3A3A3;  cursor: auto;  font-size: 14px;  top: 7px;}.small {  font-size: 10px;}input {  padding: 5px;  font-size: 11pt;  position: relative;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><input id="input" type="text" /><div class="placeholder">Email <span class="small">address</span></div>