title: Responsive web design by using css or javascript?
body: <p>I am going to make a website that is using responsive design. I read some information about css media query. What I wanna do is that the layout of my webpage should looks difference by using different devices (like PC, tablets or smartphones). </p>
  
  <p>If I use media query to determine the device by using the width of the screen (in pixel), I always worry about if there will be a new device using a extremely high ppi screen. That device may threat as tablet or something like PC?</p>
  
  <p>Another solution that is using the user agent to determine the device category by using userAgent. There's also a problem is that if the device not interpret the javascript fine then the page maybe broken.</p>
  
  <p>Any great solution that can solve my worries above? Or Which solution is better?</p>
  
  <p>Or I misunderstand the method of using media query?</p>
  
  <p>Thank you.</p>