如何设置重复x和滚动背景图像的长度和位置?

发布于 2024-10-08 22:45:07 字数 385 浏览 0 评论 0原文

我有一个要设置的背景图像。它是输入值下方的一条红线。

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来做呢?

多谢。

最好的问候,

瑞尼万卡

I have an to set background image. it is a red line under the input value.

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

the input value is like "123; 456; 789;". the red line cover all the string, its length is the same as the input width.

Is there any way to make the red line only under the "456;"?

Is there anyway to do it by CSS?

Thanks a lot.

Best regards,

Ryanivanka

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稚然 2024-10-15 22:45:07

我不完全确定这就是您所需要的,但为什么不使用 border-bottom 呢?

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

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

I'm not entirely sure this is what you need, but why not use border-bottom?

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

for a display: inline element, the border will always be underneath the text, and wrap across lines.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文