2017-01-03 24 views

回答

0

这是你在找什么?样很难说,因为你还没有真正解释你的问题/问题..

.quote_form input[type=text]{ 
    font-size: 8px; 
    transition: all 0.5s linear; 
} 

.quote_form input[type=text]:focus{ 
    padding-left: -10px; // to space the placeholder text away from the border 
    padding-top: -5px; 
    font-size: 10px; 
} 

注意:填充需要被考虑设置在input场的宽度和高度时:)

+0

我希望,他希望专注于该输入 –

+0

时,显示在该占位一些动画是的,我想动画焦点与翻译占位符 –

0

通常,您可以触发css transition申请pseudo selector,在您的情况下可能是:focus。 在这种情况下,我在为了增加placeholder的大小使用font-sizeinputs。 请考虑增加你的HTML和CSS标记,所以我们可以为您提供一个“特殊”的解决方案。

一个例子,点击输入,以重点:

input[type=text]{ 
 
font-size: 8px; 
 
transition: all 0.5s linear; 
 
border:1px solid black; 
 
} 
 
input[type=text]:focus{ 
 
padding-left: -50px; 
 
font-size: 16px; 
 
}
<input class="quote_form" type="text" name="fname" placeholder="placeholder"><br> 
 
<input class="quote_form" type="text" name="lname" placeholder="placeholder">