Files
freeCodeCamp/curriculum/challenges/english/01-responsive-web-design/css-photo-gallery/step-002.md
Nicholas Carrigan (he/him) 2868347742 feat: css photo gallery (#43602)
* feat: initial infra

* feat: create steps

* feat: prototype tests

Haven't tested locally yet :)

* feat: complete tests

* feat: move image size step

* chore: apply shaun's review suggestions

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* chore: apply kris' review suggestions

Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>

* fix: index.md linting

* chore: steps are parts in disguise

* chore: apply tom's review suggestions

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

* fix: colon to period

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2021-10-27 13:40:44 -05:00

59 lines
1.3 KiB
Markdown

---
id: 61537a8054753e2f1f2a1574
title: Step 2
challengeType: 0
dashedName: step-2
---
# --description--
Within your `head` element, add a `meta` tag with the `name` set to `viewport` and the `content` set to `width=device-width, initial-scale=1`.
Also add a `meta` tag with the `charset` set to `UTF-8`.
# --hints--
You should have two `meta` elements.
```js
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`.
```js
const meta = [...document.querySelectorAll('meta')];
const target = meta?.find(m => m?.getAttribute('name') === 'viewport' && m?.getAttribute('content').match(/width=device-width,\s?initial-scale=1(.0)?/) && !m?.getAttribute('charset'));
assert.exists(target);
```
Your other `meta` element should have the `charset` attribute set to `UTF-8`.
```js
const meta = [...document.querySelectorAll('meta')];
const target = meta?.find(m => !m?.getAttribute('name') && !m?.getAttribute('content') && m?.getAttribute('charset')?.toLowerCase() === 'utf-8');
assert.exists(target);
```
# --seed--
## --seed-contents--
```html
--fcc-editable-region--
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
--fcc-editable-region--
```
```css
```