Is it possible to detect if a site is responsive by viewing its source

I’m looking for a way to develop a php script to determine if a site is responsive.

Is there anything unique in the source that I can look for to determine this?

If the CSS the page uses provides all measurements using % ex and em then it is definitely responsive.

The more px, pt, in or cm references in the CSS the less likely it is to be responsive. It is then dependent on just which of the parts of the page those CSS commands refer to.

If the CSS contains media queries that test the width of the page and the px etc references are contained within that part of the CSS then it is more responsive than if they apply to all widths.

If the pt, in and cm references are all inside of a media print section of the CSS then they can be disregarded as paper is not responsive - it usually comes in one of two sizes - either A4 or the slightly wider and much shorter paper they use in the USA.

I have found by looking at the code in something like Firebug in Firefox if the code something resembling the following:

@media (max-width: 1020px)

It is usually a responsive website

One thing to look for is a viewport meta element like this in the head of the site pages:

<meta name="viewport" content="width=device-width, initial-scale=1">

Without that, the site is not “responsive” in the new sense of the word (as applied to web layouts).

No its not possible to check source to find that site is responsive. If you want to find the detail about responsive you should check website css there you can check the proper width, style for every screen size.

Agree with mobiwebz, no way to tell 100% for certain. php pages can easy have if switches that serve different html and css based on UIX size, and you can’t see those php switches in html source code.

Look for a viewport tag and media queries. You would not have either unless your site has some responsiveness to it.