html布局

div中内容位置

<div style="text-align:center;">
    <input type="button" class="btn btn-info" id="" value="审核">
</div>

让div置于最高层,不被其他元素覆盖

css  z-index :9999
$("#id-head-control").css("position", "fixed").css("top", "0").css("width", 1140).css("z-index",9999);

html 中 textarea 自适应

网上查了一下代码如下,可是没有成功,自己用的第二段代码可以满足需求:

<textarea style='border: 1px solid #94BBE2;width:100%;' rows=15 onpropertychange='this.style.posHeight=this.scrollHeight' id=textarea onfocus='textarea.style.posHeight=this.scrollHeight'> 
<textarea id="id_note" onscroll="this.rows++"   cols="40" name="note"></textarea>#textarea中间不能有间断,否则第一行会有空格

因为html中不能识别\n,故引入pre

pre 元素可定义预格式化的文本。被包围在 pre 元素中的文本通常会保留空格和换行符。而文本也会呈现为等宽字体。
自动换行代码

pre { 
white-space: pre-wrap; /* css-3 */ 
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ 
white-space: -pre-wrap; /* Opera 4-6 */ 
white-space: -o-pre-wrap; /* Opera 7 */ 
word-wrap: break-word; /* Internet Explorer 5.5+ */ 
} 

checkbox jquery 判断选中

<input type="checkbox" id="buy_limit_id" name="buy_limit">
$("#buy_limit_id").prop("checked")

水平垂直居中的对象的样式

#position {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 40px;
    margin: -20px 0 0 -75px;
    padding: 0 10px;
    background: #eee;
    line-height: 2.4;
}

div 很长的文字显示一行,其他的显示省略号

    width: 300px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值