why not text-index or background-image-index ?

why not text-index or background-image-index ?

It actually came to my mind while applying background image to a button where i had to hide the text and only show the background image. I work in HTML5 and CSS3 a lot and it would be easier with the new CSS3 that we could actually adjust the index of image, like background-image-index. You must be aware that in CSS3 we can actually apply more than one image to a tag as background image, and its nothing too complex just write it twice, and you are done.

I think it may not be widely used but background-image-index or at times text-index would be handy. I hope may be it is added later into CSS4 but can save us developers almost 4 to 5 different CSS properties when working with background images.

Another reason that i will prefer this is because at times background image may not load or its moved somewhere else, so if we make our code like

text-indent: -2000px;
overflow: hidden;
background-image: url(../images/image-name.png); 

there wont be anything, it will be just a blank space that might cause us trouble. If my theory worked and background-image-index was actually implementable it would be something like

background-image: url(../images/image-name.png);
background-image-index: 0;
text-index: 1;

If the image wouldn’t load it will show the normal version of the button, and it would be pretty nice.

If you agree to this approach, and you would like to have this property added to CSS3 specification i will recomment either liking it or link back to this post so it reaches the public. The more its popular, more chances we will have this added soon.

.