Images as css link

I wanted to place the image in my browser through a css file.

For example: I have an image called "Save." I do not want to have any image tags in my html, whereas I have to put it from css inside the tag ... into html (i.e. the image tag should be present in the css file, but I have to call it in html)?

It is possible .. Can someone guide me with this?

+3
source share
2 answers

HTML

<a id="save" href="save.php">Save</a>

CSS

#save {
   display: block;
   width: 20px;
   height: 20px;
   background: url(/images/save.png) no-repeat;
   text-indent: -9999px;
}
+3
source

You can use input tag

<input type = 'image' value = 'Save' src = 'save.jpg' >
+2
source

Source: https://habr.com/ru/post/1779118/


All Articles