具有背景图片的CSS,无需重复图片 [英] css with background image without repeating the image

查看:113
本文介绍了具有背景图片的CSS,无需重复图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一列(假设宽度为40px),那里有一些行.行的高度取决于文本的长度(如果文本很长,则会有一个折线,因此高度会增加).

I have a column (lets assume the width is 40px) and there I have some rows. The height of the rows depends on the length of text (if the text is long then there is a break line and therefore the height increases).

现在,我想在文本旁边的每一行中显示一个图标,以向用户显示例如他已经完成了该选项卡中的操作.所以我试图通过仅使用CSS来解决此问题.因此,如果用户完成了一个选项卡,那么我将更改该行的css.但是,如果不重复图像,则无法向该行添加图像.

Now I want to display an icon in each row next to the text to show the user for example that he has already completed something in that tab. So I was trying to solve this by using only css. So if the user completes a tab then I change the css of that row. However, I'm not able to add to that row an image without that the image is being repeated.

我正在使用此CSS代码:

I'm using this css code:

padding: 0 8px;
padding-top: 8px;
padding-right: 8px;
padding-bottom: 8px;
padding-left: 8px;
overflow: hidden;
zoom: 1;
text-align: left;
font-size: 13px;
font-family: "Trebuchet MS",Arial,Sans;
line-height: 24px;
color: black;
border-bottom: solid 1px #BBB;
background-color: white;
background-image: url('images/checked.gif');
background-repeat-x: no-repeat;
background-repeat-y: no-repeat;

有人知道怎么做吗?

推荐答案

代替

background-repeat-x: no-repeat;
background-repeat-y: no-repeat;

这是不正确的,请使用

background-repeat: no-repeat;

这篇关于具有背景图片的CSS,无需重复图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆