Skip to content

Commit

Permalink
Simplified meta charset and viewport tags
Browse files Browse the repository at this point in the history
Cut down on some cargo-culting :-)

No need for the viewport tag to forbid user scaling. `width=device-width`
is also optional these days, as mobile browsers just do the right thing
by default.[1][2] Only initial-scale is required.

[1]: h5bp/html5-boilerplate#1099
[2]: GoogleChrome/lighthouse#641 (comment)

(Note also no need for `HandHeldFriendly` meta tag, since that was only
for some old Blackberry devices, no need for `MobileOptimized` since
that was only for very old versions of Windows Mobile, and no need for
a `X-UA-Compatible` tag since IE will automtically render in Standards
Mode when a valid <!doctype> is present and the user hasn’t set any
browser options to always render in compatibility mode.)

While I was there, I tidied up the charset tag too, although we serve
theyworkforyou.com with a charset HTTP header, so most browsers will
ignore this in-page tag anyway.

Part of #1421.
  • Loading branch information
zarino authored and dracos committed Feb 3, 2021
1 parent dd7a1e8 commit 6a61a3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions www/includes/easyparliament/templates/html/header.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title><?= preg_replace('#<[^>]*>#', '', $page_title) ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="viewport" content="initial-scale=1">
<?php if (isset($meta_description)): ?>
<meta name="description" content="<?= _htmlentities($meta_description) ?>">
<?php endif; ?>
Expand Down

0 comments on commit 6a61a3b

Please sign in to comment.