<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
我需要复制此联系表。
它已经完成了,但是我在文本区域遇到了一些问题。
似乎我需要将各种“hr”放入文本区域,或者...或者我不知道。 欢迎任何帮助。
最佳答案
您可以使用 linear-gradient
,其中 background-size
等于为 textarea 定义的
,例如line-height
http://codepen.io/anon/pen/LELJzy
textarea {
font-size: 16px;
width: 80%;
height: 200px;
color: #fff;
line-height: 1.7em;
background: linear-gradient(to bottom, #000 98%, #fff 98%);
background-size: 1.7em 1.7em;
}
使用这种方法,您不需要额外请求背景图像,并且线条的位置可能会根据用户 font-size
而改变(尝试增加/减少缩放系数)。
可以调整线条的刻度,定义不同的颜色停止值。
关于html - 将边框添加到文本区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28146826/