Swap . html and css if mobile instead of m.mysite

Asked

Viewed 55 times

-2

to change . html and css if mobile instead of using m.mysite using code, have as ?

  • Face depends. Have you set up as m.site? First thing to do is to avoid targeting for m.site.. Is that your problem or your problem is with Media Queries?

1 answer

0


One way is to add specific CSS s to each resolution.

Some ways to inform CSS s for different resolutions:

<link rel="stylesheet" type="text/css" media="only screen and (max-device-width: 480px)" href="mobiel-device.css" />
<link rel="stylesheet" type="text/css" media="only screen and (min-device-width: 768px) and (max-device-width: 1024px)" href="ipad.css" />

You can add different CSS files for each resolution you need.

It is important to add this tag in the header as well so that the page width is started with the correct scale:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.