css - 如何设置 repeat-x 和滚动背景图像的长度和位置?

标签 css background-image

我要设置背景图片。它是输入值下方的红线。

background-attachment:scroll;
background-color:#FFFFFF;
background-image:url("../images/errorLine.gif");
background-position:left bottom;
background-repeat:repeat-x;

输入值类似于“123;456;789;”。红线覆盖所有字符串,其长度与输入宽度相同。

有没有什么办法可以只在“456;”下画红线

有没有办法通过 CSS 来实现?

非常感谢。

最好的问候,

瑞尼万卡

最佳答案

我不完全确定这是你需要的,但为什么不使用 border-bottom

123 <span style="border-bottom: 1px red solid">456</span> 789

对于 display: inline 元素,边框将始终位于文本下方,并跨行换行。

关于css - 如何设置 repeat-x 和滚动背景图像的长度和位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4537063/

相关文章:

jquery - Bootstrap Navbar 中的菜单项未清除 Logo

html - 在 iOS 中输入日期占位符值

:root 中的 CSS 背景图像渐变

css - 所有设备的复杂背景图像定位

javascript - 如何防止在转换背景图像时发生卡顿?

javascript - 使用视差效果, 'Active' 导航选项问题

javascript - 使用 location.reload() 后滚动到特定的 div

html - 使用 CSS 创建 PDF - 未正确设置正文高度

css - 背景附件 "fixed"在 Firefox 中不起作用

html - 停止覆盖以前的 CSS 属性