我有一个输入类型文本,其中占位符有两个值,如(英语和西班牙语)。但我希望英文文本左对齐,西班牙文本应该右对齐,但在我的情况下,我正在这样做。
Example:
<input type="text" nam="name" placeholder="Name Nombre" >
我正在使用 nbsp 这样做,但是当我在另一个窗口或响应模式下打开它时,文本变得外部或未对齐。那么我如何将占位符内的文本左右对齐,请帮我解决这个问题..
什鲁蒂
检查解决方案
If you satisfied please give me vote as a gift :)
$(document).ready(function(){
$("input").click(function(){
$("label").hide();
});
$("input").focusout(function(){
if($(this).val() !=''){
} else{
$("label").show();
}
});
});
p{position: relative; display: inline-block;}
label[for="english"] { position: absolute;left: 4px;}
label[for="spanish"] {position: absolute; right: 4px;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<p>
<label for="english">Name </label>
<label for="spanish">Nombre</label>
<input type="text" nam="name">
</p>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句