猿问
回到首页
个人中心
反馈问题
注册登录
下载APP
首页
课程
实战
体系课
手记
专栏
慕课教程
如何将 % 符号永久放在文本框中的文本末尾?
我有一个显示百分比的文本框。
我想要文本末尾的 % 符号,% 符号不应该是可编辑的,但文本框中的文本应该是可编辑的。
如何实施?
繁星点点滴滴
浏览 145
回答 3
3回答
开心每一天1111
您可以使用 :after 伪元素在纯 CSS 中完成此操作。.inputbox-container:after { content: "\0025"; margin-left: -25px; margin-right: 25px; padding-left: 6px;}input { padding-right: 20px;}<div class="inputbox-container"><input type="text"></div>
0
0
0
一只斗牛犬
像引导程序input-group.input-group { display: flex; height: 30px}.input-group input { border: 1px solid #ced4da; width: 30px;}.input-group input:focus { border-color: #80bdff; outline: 0;}.input-group span { color: #495057; background-color: #e9ecef; border: 1px solid #ced4da; padding: 7px 5px;}<div class="input-group"> <input type="text"> <span>%</span></div>
0
0
0
POPMUISE
尝试这个<input type="text"><label style="position:relative; left:-20px;">%</label>
0
0
0
打开App,查看更多内容
随时随地看视频
慕课网APP
相关分类
JavaScript
继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续