html使用心得

(1)<textarea style= "word-break:break-all" rows="5" cols="20">

在ddddddddddddddddddddddddddddddddddddd
</textarea>执行后,字母段会自动分行,如何使其不换行?

====添加属性style= "word-break:break-all",ok 。

http://www.educity.cn/wenda/4260.html

(2)div模拟textarea文本域轻松实现高度自适应

====参考:http://www.zhangxinxu.com/wordpress/2010/12/div模拟textarea文本域轻松实现高度自适应/

<!DOCTYPE html>
<html>
<head>
<style>
.test_box {
    width: 100px;
    min-height: 120px;
    max-height: 300px;
    _height: 120px;//内容高度自适应
    height: 120px;//y方向出现滚动条
    overflow: scroll;
    overflow: auto;
    outline: 0;
    border: 1px solid #a0b3d6;
    font-size: 20px;
    word-wrap: break-word;
    overflow-x: hidden;
    overflow-y: auto;
}

.test_box p {
    margin: 0;
}
</style>
</head>

<body>
    <div class="test_box" contenteditable="true"></div>
</body>
</html>

 (3)background-attachment:scroll;是什么效果

====Background-attachment:设置背景图片是否随着文字移动而移动,还是固定在一个位置上。

scroll:背景图像是随对象内容滚动
fixed:背景图像固定
http://www.w3school.com.cn/tiy/t.asp?f=csse_background-attachment

(4)onkeydown 事件

http://www.w3school.com.cn/jsref/event_onkeydown.asp

 (5)css clear 属性

http://www.divcss5.com/rumen/r424.shtml

(6)table 行间距设置

<table cellspacing='5'>

 (7)div横向排列

<div>
    <div style='display:inline'>111</div>
    <div style='display:inline'>4444</div>
</div>

http://www.divcss5.com/wenji/w472.shtml

posted @ 2015-12-02 19:24  浪荡云流  阅读(279)  评论(0编辑  收藏  举报