


Mobile Device CSS Customization:
Many web developers encounter challenges when customizing CSS for handheld devices such as iPhones and Android phones. The conventional method of using @media handheld does not work uniformly across devices.
Solution: Use @media Queries
To overcome this limitation, employ @media queries. This CSS technique allows you to target specific device characteristics, including screen size:
<link rel="stylesheet" href="iphone.css" media="only screen and (max-device-width:480px)">
This query specifically targets devices with a maximum screen width of 480px, which commonly covers iPhones.
iPhone as an Exception
iPhone browsers, powered by Safari, do not honor @media handheld due to their advanced CSS rendering capabilities. This may vary with older iOS versions.
Targeting Devices with Higher Resolutions
Some newer mobile devices, such as the Droid X, feature higher resolutions. To accommodate these devices, use more specific @media queries that incorporate screen resolution:
<link rel="stylesheet" href="shetland.css" media="screen and (max-device-width: 480px) and (resolution: 163dpi)">
Further Reading:
- [A List Apart: Media Queries for Responsive Web Design](https://alistapart.com/article/responsive-web-design)
- [W3C Candidate Recommendation for Media Queries](https://www.w3.org/TR/css3-mediaqueries/)
The above is the detailed content of How to Customize CSS for Mobile Devices: Is @media handheld Still Relevant?. For more information, please follow other related articles on the PHP Chinese website!

PWA (Progressive Web Apps) have been with us for some time now. Yet, each time I try explaining it to clients, the same question pops up: "Will my users be

It's extremely surprising to me that HTML has never had any way to include other HTML files within it. Nor does there seem to be anything on the horizon that

There are a lot of different ways to use SVG. Depending on which way, the tactic for recoloring that SVG in different states or conditions — :hover,

The inputmode global attribute provides a hint to browsers for devices with onscreen keyboards to help them decide which keyboard to display when a user has

You may already be familiar with webpack for asset management on projects. However, there’s another cool tool out there called Parcel, which is comparable to

I’ve been reading Jason Grigsby’s new book on progressive web apps this past week and it’s exciting. Jason explains what PWAs are and how they work while

CSS is what gives every website its design. Websites sure aren’t very fun and friendly without it! I’ve read about somebody going a week without JavaScript

My partner and I ran a design and development conference company for eight years. During that time, we produced hundreds of hours of conferences, both on-site


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft