I'm facing a challenge with my web page that is accessible on both mobile and desktop devices. I have two separate CSS classes for each type of device as shown below:
<div class="phone-visible">
<h1> .....</h1>
</div>
and
<div class="phone-hidden">
<h1> .....</h1>
</div>
When viewing the page on mobile, specific styles are applied. However, for SEO purposes, I want to prevent duplicate header tags from being visible in the source code when accessing the page on a particular device. In other words, I don't want the mobile <h1> tag to be displayed when viewing the page on desktop. I attempted to address this issue using CSS, but the headers still appeared in the page source. Any suggestions on how to approach this problem?