How can I style differently between iphone x and the others iphone

<div style="  margin-top: 2rem;
  margin-bottom: 2rem;">

above code is for iphone 5 …6…6plus…etc

but want to have div like below when it comes to iphone x…
How can I attain it?

<div style="  margin-top: 2.5rem;
  margin-bottom: 2.5rem;">
1 Like

Did you try using this plugin ?
https://github.com/apache/cordova-plugin-device

1 Like

I tested it on simulator…and this.device.model…and only return x86_64…