.search-input{
width: 241px;
padding: 5px 32px 5px 12px;
border: 1px solid #fd2d59;
border-radius: 18px;
border-color: #ebebeb;
background-color: #f7f7f7;
font-size: 12px;
line-height: 18px;
-webkit-transition: background-color .5s ease-in-out 0s;
-moz-transition: background-color .5s ease-in-out 0s;
-o-transition: background-color .5s ease-in-out 0s;
transition: background-color .5s ease-in-out 0s;
&:focus{
background-color: #fff;
}
}
你這是SASS?看見裡面套了個
如果瀏覽器一打開,這個input就自動獲得焦點了,那麼就會立刻改變背景色了,並不是瀏覽器初始化的問題
chrome的已知bug,Google一直未修復,html 中加入 script 標籤可以解決
例如:
<script>0</script>
stackoverflow