remove inner shadow of text input

2019-01-31 11:23发布

So I have a text input, im using html5, on chrome, and I want to change the look of a text input, I've removed the outline on focus (orange on chrome), I set the background to a light color #f1f1f1 but now there is like a thicker border on the top and left sides, like it's meant to look pushed in, when there is no change in background color this doesn't happen. How do I remove it? Sorry I can't provide a picture, on a mobile device.

It happens on chrome, ie, and Firefox, can't test any others.

7条回答
做个烂人
2楼-- · 2019-01-31 11:41

border-style:solid; will override the inset style. Which is what you asked.

border:none will remove the border all together.

border-width:1px will set it up to be kind of like before the background change.

border:1px solid #cccccc is more specific and applies all three, width, style and color.

Example: https://jsbin.com/quleh/2/edit?html,output

查看更多
对你真心纯属浪费
3楼-- · 2019-01-31 11:41

This is the solution for mobile safari:

-webkit-appearance: none;

as suggested here: Remove textarea inner shadow on Mobile Safari (iPhone)

查看更多
Deceive 欺骗
4楼-- · 2019-01-31 11:45

None of the solution are working currently. Here is my solution. You can add prefixes.

box-shadow: inset 0px 0px 0px 0px red;
查看更多
戒情不戒烟
5楼-- · 2019-01-31 11:46

Try this
outline: none;

live demo https://codepen.io/wenpingguo/pen/KQgbXq

查看更多
▲ chillily
6楼-- · 2019-01-31 11:48

Set border: 1px solid black to make all sides equals and remove any kind of custom border (other than solid). Also, set box-shadow: none to remove any inset shadow applied to it.

查看更多
三岁会撩人
7楼-- · 2019-01-31 11:52

I'm working on firefox. and I was having the same issue, input type text are auto defined something looks like boxshadow inset, but it's not. the you want to change is border... just setting border:0; and you're done.

查看更多
登录 后发表回答