本文实例讲述了JS实现的类似微信聊天效果。分享给大家供大家参考,具体如下:
& lt; !DOCTYPE html> & lt; html lang=癳n”比; & lt; head> & lt;元charset=皍tf - 8”比; & lt; title> www.jb51.net JS仿微信聊天效果& lt;/title> & lt; style> * { 保证金:0; 填充:0; } .box { 宽度:250 px; 身高:400 px; 边界:1 px固体# cccccc; 浮:左; margin-left: 200 px; 位置:相对; } .fox { 宽度:250 px; 身高:400 px; 边界:1 px固体# cccccc; 浮:左; margin-left: 200 px; 位置:相对; } .box1 { 宽度:250 px; 高度:20 px; 背景:# cdcdcd; 行高:20 px; text-align:中心; } .fox1 { 宽度:250 px; 高度:20 px; 背景:# cdcdcd; 行高:20 px; text-align:中心; } .box3 { 宽度:250 px; 高度:30 px; 底部:0 px; 位置:绝对的; } .fox3 { 宽度:250 px; 高度:30 px; 底部:0 px; 位置:绝对的; } .input1 { 宽度:200 px; 高度:28 px; } .input2 { 宽度:40像素; 高度:30 px; } .input3 { 宽度:200 px; 高度:28 px; } .input4 { 宽度:40像素; 高度:30 px; } .text1 { 溢出:滚动; overflow-x:隐藏; overflow-y:可见; 身高:350 px; } .text2 { 溢出:滚动; overflow-x:隐藏; overflow-y:可见; 身高:350 px; } & lt;/style> & lt;/head> & lt; body> & lt; div类="盒子"比; & lt; div类=" box1 "祝辞AAAAAAAA