禁用jss的css

时间:2012-04-09 11:56:23

标签: html css

我在html中有一个日期和时间选择器代码如何禁用此特定项目的css规则?

我的代码如下:

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>TaskManager</title>




</head>


<style>
select {  

padding:10px 10px;

width:300px;

background:#262626;

border-bottom: 1px double #171717;

border-top: 1px double #171717;

border-left:1px double #333;

border-right:1px double #333;
}


div.box .mesaj{

padding:7px 7px;

width:285px;

background:#262626;

border-bottom: 1px double #171717;

border-top: 1px double #171717;

border-left:1px double #333;

border-right:1px double #333;

overflow:scroll;

height:150px;

}

div.box .buttonu

{

margin:0 0 10px 0;

padding:5px 7px;

background:#CC0000;

border:0px;

position: relative;

top:5px;

left:320px;

width:100px;

border-bottom: 1px double #660000;

border-top: 1px double #660000;

border-left:1px double #FF0033;

border-right:1px double #FF0033;

}

</style>
<script src="datetimepicker_css.js"></script>




<body>

     <form name="myform" action="/addtasknow.html" method="post">
     <div class="box">

     <h1>Add New Task</h1>
     <label>
     <span>Partner</span>
     <select name="f_friend">
     %body%
     </select>
     </label>
     <label>
     <span>Date and Time</span>
     <input type="Text" id="demo1" maxlength="25" size="25"/>

     <img src="images2/cal.gif" onclick="javascript:NewCssCal ('demo1','yyyyMMdd','dropdown',true,'12')" style="cursor:pointer"/>
     <label>
     <input type="submit" class="buttonu" value="Add Alarm" />
     </div>

</form>

1 个答案:

答案 0 :(得分:0)

一个简单的jquery技巧就可以了。

$('#demo1').addClass('newClass');

创建一个包含所需属性的新类

margin : opx !important; 

它会强制css为元素设置为0px margin。