javascript - How to do border inside the input? - Stack Overflow

I have qoestion About Input border.I need to create a solid color inset border.I have an input And I

I have qoestion About Input border.

I need to create a solid color inset border. I have an input And I want To put Border Inside It And when I hover On it border will Get smaller I Found A Solution here But It Can't Work Becuase I can't append span or div inside the input to put border on it

        <input class="task-text" type="text" name="task" id="user-task">

this is the link of similar problem

<[1]: ;

Any Solution?

I have qoestion About Input border.

I need to create a solid color inset border. I have an input And I want To put Border Inside It And when I hover On it border will Get smaller I Found A Solution here But It Can't Work Becuase I can't append span or div inside the input to put border on it

        <input class="task-text" type="text" name="task" id="user-task">

this is the link of similar problem

<[1]: https://stackoverflow./questions/8452739/css-inset-borders>

Any Solution?

Share Improve this question asked Jul 9, 2020 at 4:09 يوسف علي Yousef aliيوسف علي Yousef ali 11 silver badge1 bronze badge
Add a ment  | 

2 Answers 2

Reset to default 2

Something like this?

.task-text {
  padding: 5px;
  outline: none;
  border: none;
  box-shadow: inset 0 0 0 5px red;
}

.task-text:hover {
  box-shadow: inset 0 0 0 2px red;
}
<input class="task-text" type="text" name="task" id="user-task">

You can do this by using the css outline and the css outline-outset properties.

input {

  padding: 10px;
  outline: 1px solid black;
  outline-offset: -10px;

}
<input type="text">

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745656878a4638594.html

相关推荐

  • javascript - How to do border inside the input? - Stack Overflow

    I have qoestion About Input border.I need to create a solid color inset border.I have an input And I

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信