Best use for responsive image backgound

Hello Themeco dudes and dudettes,
I have a image background for a header that must change width for 3 breakpoints, so i have a grid with 3 cells in it, each cell has its background image width size and it’s H1 title:

01
All seems cool and It gives control on the headline font size of the 360px one that has to be a little smaller than the other ones. But yoast seo tell me that there shouldn’t be severals H1 title, so i’m not sure it’s the best way to do this.

So I tried with breaking point in the element css :

$el {
  font-family:'viner';
}
@media (min-width: 1200px) {
    $el{
      background-image: url("fond-header.jpg");
      background-repeat:no-repeat;
      background-position:center;}
}
@media (min-width: 768px) and (max-width: 1199px) {
    $el{
      background-image: url("fond-header-2.jpg");
      background-repeat:no-repeat;
      background-position:center;}
}
@media (min-width: 1px) and (max-width: 767px) {
    $el{
      background-image: url("fond-header-3.jpg");
      background-repeat:no-repeat;
      background-position:center;
      font-size:28px;}
}

(I’m a little noob with css, if this css code can be improved, tell me how)
but the font-size has no effect for the 360px one (why? i tried with a !important but it’s not working too), so, what is the best way to achieve this changing width image with breakpoints with font size control for one width?

Hi @Lyser,

Thanks for reaching out.
It seems that Yoast Seo trying to point that you have Multiple <h1> tag on your page. That might be due to the Headline element is used in the multiple breakpoints. I would suggest you choose the <h1> as a base tag of the Headline for a single time, and use any different base tag for other Headline elements you used.

Hope it helps.
Thanks

Ok, thx Tristup, and is it better to construct breaking points images with differents cells or with css ? Or it does not matter ?

Hi @Lyser,

It does not matter whether you are breaking into different cells or not.

Thanks

Thx you very much !

Hi @Lyser,

You are most welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.