+ 1
How To Add Alt text on images
I want to add alt text to images while using CSS but unable to do , I am using these following code , and wants to add alt text to image , how can i do <head><style>.user { display: inline-block; width: 150px; height: 150px; border-radius: 50%; background-repeat: no-repeat; background-position: center center; background-size: cover; } .one { background-image: url('http://placehold.it/400x200'); } </style></head> <body><div class="user one"></div></body> https://code.sololearn.com/W8B7ux8ZH1bJ/?ref=app
2 odpowiedzi
+ 5
Personally I would use the title attribute for the containing div instead of an alt in the css.
+ 1
but I need alt
so how can I do that