从CSS中的类中删除样式

时间:2017-01-02 05:20:29

标签: jquery html css

我有一个这个类的输入标签,可以从kendostyle

获取它
private GT_Member mother;

private GT_Member father;

private GT_Family ownerF;

private List<GT_Member> children;

和k-input类是:

<input class="k-textbox k-input" >

现在,我不想要这种风格

.k-input{
    height: 2.214em;
    line-height: 2.214em;
    padding: .177em 0;
    text-indent: .8em;
    border: 0;
    margin: 0;
}

在本课程中,我该怎么做?

我无法编辑此类是css文件,因为它用于其他一些标记

6 个答案:

答案 0 :(得分:2)

以其他方式添加css

.k-textbox.k-input{height:auto;}

答案 1 :(得分:1)

添加父div,然后添加样式

<div class="parent">
  <input class="k-textbox k-input" >
</div>

.parent > .k-input{
  height: auto;
}

答案 2 :(得分:1)

将属性更改为空字符串似乎可以完成这项工作。

$(".k-input").css("height", "");

答案 3 :(得分:1)

@ user2830448请根据您的要求检查以下代码。您可以根据需要在第一个输入中更改高度:

<div class="custom_parent">
    <input  type="text" class="k-textbox k-input" >
</div>  

<input class="k-textbox k-input" >
-- {superfluous} means some other columns which are not related to this question

// q&a
+----+-----------------+--------------------------+------+-----------+-----------+
| id |      title      |            body          | type |  related  | author_id |
+----+-----------------+--------------------------+------+-----------+-----------+
| 1  | How can I ...   | I'm trying to make ...   |  q   | NULL      | 3         |
| 2  |                 | You can do that by ...   |  a   | 1         | 1         |
| 3  | Why should I .. | I'm wonder, why ...      |  q   | NULL      | 1         |
| 4  |                 | First of all you ...     |  a   | 1         | 2         |
| 5  |                 | Because that thing ...   |  a   | 3         | 2         |
+----+-----------------+--------------------------+------+-----------+-----------+

// users
+----+--------+-----------------+
| id |  name  |  {superfluous}  |
+----+--------+-----------------+
| 1  | Jack   |                 |
| 2  | Peter  |                 |
| 3  | John   |                 |
+----+--------+-----------------+

// votes
+----+----------+-----------+-------+-----------------+
| id |  user_id |  post_id  | value |  {superfluous}  |
+----+----------+-----------+-------+-----------------+
| 1  | 3        |  4        |  1    |                 |
| 2  | 1        |  1        | -1    |                 |
| 3  | 2        |  1        |  1    |                 |
| 4  | 3        |  2        | -1    |                 |
| 5  | 1        |  4        |  1    |                 |
| 6  | 3        |  5        | -1    |                 |
+----+--------+-------------+-------+-----------------+

// tags
+----+------------+-----------------+
| id |    name    |  {superfluous}  |
+----+------------+-----------------+
| 1  | PHP        |                 |
| 2  | SQL        |                 |
| 3  | MySQL      |                 |
| 4  | HTML       |                 |
| 5  | CSS        |                 |
| 6  | C#         |                 |
+----+------------+-----------------+

// q&aTag
+-------+--------+
| q&aid | tag_id |
+-------+--------+
| 1     | 1      |
| 1     | 4      |
| 3     | 5      |
| 3     | 4      |
| 4     | 6      |
+-------+--------+

答案 4 :(得分:1)

如果您不想要特定行的样式,可以使用内联css

覆盖css

<input class="k-textbox k-input"  style="height: auto;">

答案 5 :(得分:1)

在div中添加一次静态div和换行文本框。

试试这个..

<div class="cstm-input">
<input class="k-textbox k-input" />
</div>


div.cstm-input .k-input{
    height: auto !important;
}

你也可以通过jQuery做到这一点..

我希望对你有所帮助......