zoukankan      html  css  js  c++  java
  • [CSS]textarea设置下划线格式

    功能要求:
    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>
    

      

  • 相关阅读:
    迭代器
    关于文章cisco漏洞4786
    Python学习目录
    Python的xml模块
    【JS30】Event Capture, Propagation, Bubbling and Once
    mysql安装
    CS193P 第四课笔记 · Hexo
    CSS变量
    在CentOS7上开启和挂载NFS共享
    《Android 编程实战》Chap5_重识IPC
  • 原文地址:https://www.cnblogs.com/cztom/p/6256717.html
Copyright © 2011-2022 走看看