I have been trying to utilize the following code to create a Google search bar that expands when focused within a w3.css navigation bar-item. While it does expand and contract on focus/blur, I am unable to achieve smooth transitions between sizes. The search bar simply jumps from small to large without any transition effects. Any tips or suggestions would be greatly appreciated. Thanks in advance!
input[type=text] {
size:20;
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
}
<form method="get" action="http://www.google.com/search">
<div class="w3-bar-item w3-right w3-hide-small w3-padding-
1"style="border:2px dotted black;padding:1px;width:15em;">
<table border="0" align="right" cellpadding="0">
<tr><td>
<input class="w3-small w3-bar-item" type="text" name="q" size="20"
style="color:#808080;
maxlength="200" value="Google Search..."
onfocus="if(this.value==this.defaultValue)this.value='';
this.style.color='black'; this.size='25';"
onblur="if(this.value!='this.defaultValue')this.value=this.defaultValue;this.size='20';"/>
<button type="submit" class="btn btn-primary w3-right w3-small w3-theme-l1
w3-button w3-bar-item ">
<i class="fa fa-search"></i>
</button>
</table>
</div>
</form>