如何在添加背景图像时删除文本框周围的边框

GIV*_*ITY 4 css html5 css3

我有一个文本框,我删除了默认边框 outline:none; 但是,当我添加背景图像时,边框显示,无法删除!

我怎么摆脱这个?这是方框:

<input type = "text" placeholder = "Username" class = "txt_input">
Run Code Online (Sandbox Code Playgroud)

和css:

background: url('images/user-icon.png') left no-repeat;
margin-bottom: 5px;
box-shadow: 0px 0px 1px 0px rgba(0,0,0,0.5);
font-family: 'ProximaNova-Bold';
outline: none;
width: 200px;
height:30px;
text-align: center;
text-transform: capitalize;
padding:15px;
padding-left:21px;
Run Code Online (Sandbox Code Playgroud)

Axe*_*hor 11

添加border: 0px none;到您的CSS?轮廓仅处理焦点边框.

  • 0px是无效的CSS.你应该做`border:0;` (2认同)