前端 - CSS 如何设置自动滚动定位的“安全”间距?_个人文章 - SegmentFault 思否
欢迎关注我的公众号:前端侦探介绍两个和滚动定位相关的 CSS 属性:scroll-padding和 scroll-margin在平时开发中,经常会碰到需要快速定位的问题,比如常见的锚点定位<l
顺晟科技
2021-10-01 14:25:45
146
功能要求:
1:如何实现在多行文本框textarea里面每一行下面都有一条横线
2:textarea文本框里面有一段不能删掉
实现方法:
横线用背景图片来做,不动的文字用浮动层+给textarea增加text-indent来实现缩进。
源代码如下:
<!DOCTYPE html> <html lang="zh"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta charset="utf-8" /> <title>Textarea设置下划线格式</title> <style type="text/css"> .input{position:relative} .word{position:absolute;line-height:20px;left:0px;top:1px;z-index:10;background:#fff} .input textarea{border:none; text-indent:75px;line-height:20px;background:url(http://www.w3dev.cn/eg/linebg.gif) repeat;overflow:auto} </style> </head> <body> <div class="input"> <div class="word">护理措施:</div> <textarea class="input" rows="5" cols="50"></textarea> </div> </body> </html>
17
2022-11
19
2022-10
19
2022-10
12
2022-10
15
2022-09
15
2022-09