css

2 篇文章 0 订阅

1. 添加css,显示隐藏提示
<td id="error" style="color:red;display:none" >结束时间必须大于起始时间</td>

先隐藏,搜索条件有误时展示,重置时隐藏。

$("#error").css("display","none");
if(dateA>dateB){
    $("#tr1").append("&nbps;&nbps;<td id='error' style='color:red'>终止时间必须大于起始时间</td>");
}
追加会有问题。

显示:
document.getElementById('error').style.display="block";
$("#error").css("display","block");
$("#error").show();
$("#error").attr("style","display:block;");
消失:
document.getElementById('error').style.display="none";
$("#error").css("display","none");
$("#error").hide();
$("#error").removeAttr("style");


2.ul无点
ul li{list-style:none;}

3.焦点:选中的框的颜色变化;离焦:框的颜色恢复。
 onFocus="this.className='input_all name_now';" onBlur="this.className='input_all name'

.input_all{
    border:none;
    color:#555;
    font-size:14px;
    line-height:30px;
    padding:10px 0 10px 46px;
    vertical-align:middle;
    width:190px;
    height:30px
}
.name{
    background:url("../images/input_name.png") no-repeat top left
}
.name_now{
    background:url("../images/input_name_hover.png") no-repeat top left
}

4. CSS3 比如部分属性在Firefox上应用需要加上-moz-、Safari以及Google Chrome需加上-webkit-、Opera需加上-o-、Internet Explorer 9需加上-ms-。
 圆角属性 border-radius: 10px;  

5.line-height
 line-height是行高,height就是高,通常height是对于某个框架或者图片来弄的,line-height用于文字.

<div class="test">文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字</div>
如果我们定义.test {line-height:20px;},那么这个元素的实际高度将取决于其中内容的多少。
假如文字部分在浏览器里面显示为一行,那么这个div的实际高度就是20px,如果文字显示为两行,那么div的实际高度就是40px,而且文字的行高是20px的。

line-height和height组合使用,如果把它们的值设置的一样了,文字就会在垂直方向居中。

6. z-index
 此属性设置元素的堆叠顺序。拥有更高堆叠顺序的元素总是会处于堆叠顺序较低的元素的前面。
注释:元素可拥有负的 z-index 属性值。
注释:z-index 仅能在定位元素上奏效(例如 position:absolute;z-index:9999;)!
例如:搜索框,输入搜索字段,弹出下拉搜索结果(异步)。当选中某个搜索结果时,此框消失:$("#div").hide();

7. 灰色:style="color:#B0B0B0"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值