[英]Remove a style from a class in CSS
我有一個輸入標簽與此類從kendostyle獲得它
<input class="k-textbox k-input" >
和k輸入類是:
.k-input{
height: 2.214em;
line-height: 2.214em;
padding: .177em 0;
text-indent: .8em;
border: 0;
margin: 0;
}
現在,我不需要樣式
height: 2.214em;
在這堂課中,我該怎么做?
我無法編輯此類為css文件,因為它已在其他一些標簽中使用
這樣添加其他CSS
.k-textbox.k-input{height:auto;}
添加父div然后樣式像
<div class="parent">
<input class="k-textbox k-input" >
</div>
.parent > .k-input{
height: auto;
}
將屬性更改為空字符串似乎可以完成這項工作。
$(".k-input").css("height", "");
@ user2830448請根據您的要求檢查以下代碼。 您可以根據需要在第一輸入中更改高度:
.k-input{ height: 2.214em; line-height: 2.214em; padding: .177em 0; text-indent: .8em; border: 0; margin: 0; } .custom_parent .k-input{ height:auto !Important; }
<div class="custom_parent"> <input type="text" class="k-textbox k-input" > </div> <input class="k-textbox k-input" >
如果您不想特定行的樣式,可以使用內聯css
覆蓋CSS
<input class="k-textbox k-input" style="height: auto;">
添加一次靜態div並將文本框包裝在div中。
嘗試這個..
<div class="cstm-input">
<input class="k-textbox k-input" />
</div>
div.cstm-input .k-input{
height: auto !important;
}
您也可以通過jQuery完成此操作。
希望對您有幫助...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.