最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - In IOS hide input field blinking cursor for CSS - Stack Overflow

programmeradmin2浏览0评论

How to hide ios input field blinking cursor. am trying so many ways it's not working for me.

In Windows,

SCSS

.input--textfield {
    border: none;
    color: transparent;
    display: inline-block;
    font-size: 2em;
    text-shadow: 0 0 0 gray;
    
    &:focus {
        outline: none;
    }
}

HTML

<input type="text" name="" value="10" class="input--textfield">

Working for me,

IOS

Not working below code, do you have any suggestion.

How to hide ios input field blinking cursor. am trying so many ways it's not working for me.

In Windows,

SCSS

.input--textfield {
    border: none;
    color: transparent;
    display: inline-block;
    font-size: 2em;
    text-shadow: 0 0 0 gray;
    
    &:focus {
        outline: none;
    }
}

HTML

<input type="text" name="" value="10" class="input--textfield">

Working for me,

IOS

Not working below code, do you have any suggestion.

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Jun 22, 2018 at 5:14 SasthaSastha 1311 gold badge2 silver badges7 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

Try below it's very simple and working for me in IOS (5s, 6), IOS desktop and windows.

.input--textfield { caret-color: transparent;
}
<input type="text" name="" value="10" class="input--textfield">

ios android

.input--textfield {
  border: none;
  color: transparent;
  caret-color: transparent;
  text-indent: -999em;
}
<input type="text" name="" value="10" class="input--textfield">
发布评论

评论列表(0)

  1. 暂无评论