您的位置:首页 > Web前端 > CSS

底部线条css样式

2016-04-05 15:46 162 查看
1.首先固定宽高 (将文字移至左边,例如 “姓名:”)

.line{

width:100%;

height:40px;

float:left;

border-bottom:1px solid #ccc

}

.title{

height:38px;

width:50px;

line-height:38px;

float:left;

text-align:right

}

2.写个js语句控制默认文字的位置(例如:“请输入您的姓名”):

<!-- 控制行宽 -->

<script>

var inputWidth = document.body.scrollWidth - 100;

$(".inputStyle").css("width", inputWidth + "px");

</script>

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: