Webs for Mobiles


J

JohnW-Mpls

What coding distinguishes devices accessing a web site?

One site I visit treats access by a mobile device like droid or ipad
differently than access by a regular note/desk computer. That is good -
the screen size for each is vastly different and the presentations may well
be different but both from the same websites pages.

I can guess at the programming out from index.html but I have no clue as to
how index.html would know the accessing device type.

Anyone know? Or are my assumptions wrong - it's different?
 
Ad

Advertisements

I

Idle

What coding distinguishes devices accessing a web site?

One site I visit treats access by a mobile device like droid or ipad
differently than access by a regular note/desk computer. That is good -
the screen size for each is vastly different and the presentations may well
be different but both from the same websites pages.

I can guess at the programming out from index.html but I have no clue as to
how index.html would know the accessing device type.

Anyone know? Or are my assumptions wrong - it's different?

Depends.
They could be detecting the device accessing the site and serving up a
mobile version, or the main site could be a responsive designed site
which auto responds to the size of the viewport.
 
Ad

Advertisements

K

Kim André Akerø

What coding distinguishes devices accessing a web site?

One site I visit treats access by a mobile device like droid or ipad
differently than access by a regular note/desk computer. That is good -
the screen size for each is vastly different and the presentations may
well
be different but both from the same websites pages.

I can guess at the programming out from index.html but I have no clue as
to
how index.html would know the accessing device type.

Anyone know? Or are my assumptions wrong - it's different?

The index.html file itself wouldn't know the difference, although a
server-side script might analyze the user agent string sent by the browser
and present different types of content.

However, the best approach would be to create a responsive design that
would fit any screen type, whether it's a desktop browser, a smartphone
(or web-capable mobile phone), or a tablet. A responsive design would also
fit perfectly using both landscape and portrait display modes on mobile
devices.
http://en.wikipedia.org/wiki/Responsive_web_design

As an alternative, you can create a separate stylesheet just for mobile
devices, and serve it by specifying the stylesheet "media" type.
http://www.w3.org/TR/CSS2/media.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top