0

I've already performed media queries for different screen sizes, but I want to have different css if the website is viewed on mobile. So even if the screen is the same min-width on desktop and mobile, I want to have different css.

Any idea how I can do this?

3

1 Answer 1

2

Could use userAgent?

loadUserAgent () { let UA = navigator.userAgent; if(UA.match(/Android/) || UA.match(/iPhone/) || UA.match(/BlackBerry/) || UA.match(/iPod/) || UA.match(/Windows Phone/) || UA.match(/iPad/) || UA.match(/webOS/)) { this.isMobile = true; } } 

If you want to support other devices such as Blackberry, Opera Mini etc. Your going to have to add their user agents manually.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.