Files
freeCodeCamp/curriculum/challenges/english/14-responsive-web-design-22/learn-responsive-web-design-by-building-a-piano/612e77aba7ca691f598feb02.md
Naomi Carrigan 16e7cdedb1 feat: migrate filenames to IDs (#45146)
* feat: migrate filenames to IDs

* feat: migrate balance sheet file names

* revert: no id name for cert projects

* fix: i swear i know what i'm doing
2022-03-02 09:06:00 -06:00

1.4 KiB

id, title, challengeType, dashedName
id title challengeType dashedName
612e77aba7ca691f598feb02 Step 2 0 step-2

--description--

Add two meta tags, one to optimize your page for mobile devices, and one to specify an accepted charset for the page.

--hints--

You should add two meta elements to your page.

const meta = document.querySelector('meta');
assert.exists(meta);

You should have two meta elements.

const meta = document.querySelectorAll('meta');
assert(meta?.length === 2);

One meta element should have a name set to viewport, and content set to width=device-width, initial-scale=1.0.

const meta = [...document.querySelectorAll('meta')];
const target = meta?.find(m => m?.getAttribute('name') === 'viewport' && m?.getAttribute('content') === 'width=device-width, initial-scale=1.0' && !m?.getAttribute('charset'));
assert.exists(target);

The other meta element should have the charset attribute set to UTF-8.

const meta = [...document.querySelectorAll('meta')];
const target = meta?.find(m => !m?.getAttribute('name') && !m?.getAttribute('content') && m?.getAttribute('charset') === 'UTF-8');
assert.exists(target);

--seed--

--seed-contents--

<!DOCTYPE html>
<html>
  <head>
    <title>Responsive Web Design Piano</title>
    --fcc-editable-region--

    --fcc-editable-region--
  </head>
  <body></body>
</html>