1

Here is my code, I want to apply title and alt tag for SEO, how do I do that??

<section class="py-5 bg-image-full offset img-responsive" id="blog" style="background-image: url('image/cover5.png');">
Shailesh Yadav
  • 205
  • 3
  • 12
  • You can't - a better alternative would be to embed an `img` element somewhere else on the page and optimise that with the right attributes, ideally with any optimised copy. – UncaughtTypeError Nov 21 '17 at 11:17
  • there is no `Alt` attribute for `background-image` you can only use `title`. – Mhd Alaa Alhaj Nov 21 '17 at 11:17
  • @AlaaMh how can I use title?? – Shailesh Yadav Nov 21 '17 at 11:19
  • 1
  • 1
    Deleted my answer since this has been marked as a duplicate. However, since the top answer on the dupe doesn't mention them, I'll reiterate here that you should probably use a combination of title and arial-label to be screen-reader friendly : `
    `
    – delinear Nov 21 '17 at 11:26
  • @delinear, theoretically, the best course of action would be to add an answer to the question the current one duplicates. However, if you feel your answer rather applies to the current question and there's a meaningful difference between them, there's nothing wrong with letting your answer stand. Note duplicates are not deleted. They serve a very important role of better indexing (SEO) and, overall, help people find answers quicker. I'd even say having a list of questions that duplicate current in the original question might be helpful to both SEO and coders seeking answers. – tao Nov 21 '17 at 11:44
  • @Andrei Gheorghiu That's helpful to know, thanks. I think it's fine in this case - the aria-label answer is there on the referenced thread, it just has far fewer upvotes than the most popular answer. I mention it here just in case OP didn't spot it and took the top answer as definitive. – delinear Nov 21 '17 at 11:51

0 Answers0