@media only screen and (min-width: 768px) and (orientation:portrait) and (min-height:1024px)
You must also specify the minimum width and minimum height to indicate the maximum width and height, combining it with the orientation, then you really catch up with mobile phones without affecting others, such as tablets or PCs, now only with a minimum width for mobile phones will also affect on all devices providing a minimum width
source share