本文介紹了如何刪除輸入類型中的默認顏色?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我已經創建了輸入類型并為該框創建了邊框,但是當我單擊該按鈕時,它顯示的是默認顏色,但我不應該顯示默認顏色下面是顯示的圖像:
I had created the input type and created the border the border for that box,but when i had clicked in that button it is displaying the default color but i should not display the default color Below is the displayed image:
下面是我的html代碼:
Below is my html code:
<ion-item class="Credit">
<ion-input type="number"
placeholder="Credit Card number"
class="form-control"></ion-input>
</ion-item>
下面是我的css代碼:
Below is my css code:
.Credit{
top: 20px;
border-radius: 10px;
width: 350px;
display: block;
margin-left: auto;
margin-right: auto;
background: url(../assets/images/credit_card.png);
background-position:right;
background-size: 45px;
background-repeat:no-repeat;
border:1px solid #DADADA;
margin-bottom: 10px;
}
推薦答案
你可以嘗試重寫Ionic的樣式規則,因為輸入有效或無效時也會發生同樣的情況:
You can try by overriding Ionic's style rules, because the same will also happen when the input is valid or invalid:
/* Workaround to hide android default validation colors */
ion-item.item-md.item-input.input-has-focus .item-inner,
ion-item.item-md.item-input.ng-valid.input-has-value:not(.input-has-focus) .item-inner,
ion-item.item-md.item-input.ng-invalid.ng-touched:not(.input-has-focus) .item-inner {
border-bottom-color: #dadada;
box-shadow: none;
}
/* Workaround to hide window phone default validation colors */
ion-item.item-wp.item-input.input-has-focus .text-input,
ion-item.item-wp.item-input.ng-valid.input-has-value:not(.input-has-focus) .text-input,
ion-item.item-wp.item-input.ng-invalid.ng-touched:not(.input-has-focus) .text-input {
border: 2px solid #dadada;
}
更新
解決這個問題的更離子方式是在 variables.scss
文件中添加以下內容:
A more Ionic way to solve this, would be by adding the following in the variables.scss
file:
// Ionic variables override
$text-input-ios-show-focus-highlight: false;
$text-input-md-show-focus-highlight: false;
$text-input-wp-show-focus-highlight: false;
這篇關于如何刪除輸入類型中的默認顏色?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!