如何使用没有图像的jquery获取圆角文本框

Raj*_*kar 4 javascript css jquery rounded-corners

我试图获得文本框的圆角.但我怎么能得到它.这是班级

.tbox
{
 float:left;
 width:200px;
 margin-top:10px;
 margin-left:10px;

}
Run Code Online (Sandbox Code Playgroud)

当我使用jquery调用时

$('.tbox').corners("4px");
Run Code Online (Sandbox Code Playgroud)

它不起作用.我已经包含了Jquery.js和jquery.corners.js.但它不起作用.任何帮助,将不胜感激

Ark*_*jee 8

您可以将以下类添加到圆角的文本框中:

class="text ui-widget-content ui-corner-all"
Run Code Online (Sandbox Code Playgroud)

希望这会对你有所帮助.


rah*_*hul 5

您可以创建一个圆角div,并在该位置内部放置一个没有边框的文本框.我认为这将是满足您需求的最简单方法.

<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.corner.js" type="text/javascript"></script>

<script>
    $(document).ready ( function () {
        $("#div1").corner("round");
    });
</script>

<style>
#div1 { width: 200px; height: 30px; background-color: #a9a9a9; }
#txtBox { width: 180px; height: 20px; background-color: transparent; position: relative; top: 5px; left: 10px; border-style: none; }
</style>


<div id="div1">
    <input type="text" id="txtBox" />
</div>
Run Code Online (Sandbox Code Playgroud)