Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css with background image without repeating the image

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).

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.

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; 

Does anyone know how to do that?

like image 328
mkn Avatar asked Nov 07 '11 16:11

mkn


People also ask

How do I make my background image not repeat CSS?

If you want the background image not to repeat at all, use background-repeat: no-repeat; .

Why does my background image repeat in CSS?

By default, a background-image is repeated both vertically and horizontally. Tip: The background image is placed according to the background-position property. If no background-position is specified, the image is always placed at the element's top left corner.

Which background property specifies whether the background image is repeated or not?

Description. The background-repeat CSS property specifies whether the background-image is repeated or tiled after it has been sized and positioned, and how. It is often more convenient to use the shorthand background property.


1 Answers

Instead of

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

which is not correct, use

background-repeat: no-repeat; 
like image 55
MOleYArd Avatar answered Nov 08 '22 20:11

MOleYArd