Reputation: 459
I'm updating site and the mobile view isn't looking that presentable. I tried rewriting the code, but it's still frustrating, as I wasn't the person who built the front-end
Is there any code either in the { header } or a JavaScript function that can achieve this?
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
Upvotes: 0
Views: 10054
Reputation: 1060
Here are a couple of things you can try -
<meta name="viewport" content="width=1024">
<meta name="viewport" content="width=device-width, initial-scale=0.1">
(See, it's 0.1 instead of 1.0)
Upvotes: 1
Reputation: 1372
You can change the meta link to display a desktop version:
<meta name="viewport" content="width=1024">
Instead of the responsive version which is:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Upvotes: 2
Reputation: 534
I recommended a few solutions for you
if you want to identify the device use JavaScript
/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)
OR
'ontouchstart' in document.documentElement)
But you can use css with screen width
@media only screen and (max-width: 560px) { .exampleclass {} }
Or create a custom file for the mobile version and call it in the header
<link rel="stylesheet" media="screen and (max-width: 560px)" href="mobile.css" />
Upvotes: 1