I have a web page and that page can be viewed both on mobile and desktop. However i have two different css classes like below:
<div class=phone-visible>
<h1> .....</h1>
</div>
and
<div class=phone-hidden>
<h1> .....</h1>
</div>
so basically when i open the page on mobile see some content/styles which i write specifically for mobile.
But for SEO purpose, when the page loads i dont want to see the duplicate header tags when i open on a specific device, like i dont want to see the mobile tag when i open my page on desktop.( basically in view source i dont want this to be displayed) I tried doing in CSS( referring to solution in other posts) but that didnt resolve my issue as those still show up on source.
Any particular approach?
2
Answers
Use CSS Media queries to control the UI in different Screen size
below example might help you.
You only need one instance of the H1 tag.
Then use your responsive CSS to style according to the viewport size. That’s what responsive is all about! All you would need is to edit the smaller view port size.
So, improving on Yubraj’s answer, leave your largest screen size CSS in the main section of your CSS and then add your mobile css here: