@davy_yg This is inefficient. It means on mobile, where connections may be slower or the user has a limited data plan, you’re making them download a web page that contains information they’re never going to see.
Use a responsive design instead that presents the information in the most optimal way for the viewport size, instead of sending duplicate content which will also get you penalised by search engines.
The thing is the code is different on mobile and on pc. On PC I would like to content filter side by side with the product content. Whereas on mobile, the content filter and content are in a row. Therefore, I would like the list view on mobile automatically show up and I could delete the grid view.
@davy_yg You do not need to duplicate HTML just to go from a two-column layout on larger screens to a stacked layout on smaller screens. You really need to look into responsive web design.
You should not be sending unnecessary HTML to a mobile device for multiple reasons:
People on mobile may have plans with limited data. You’re eating their data allowance by sending them massive chunks of HMTL that they’ll never see if you just “hide” it on mobile devices.
Putting the same content on one page multiple times is going to harm your SEO.
Mobile devices aren’t as powerful as laptop or desktop computers, so sending them massive web pages with HTML and assets they don’t need is just wasting the processing power of the user’s device, and is going to drain their battery quicker.