---
id: 61437d575fb98f57fa8f7f36
title: Hatua ya 1
challengeType: 0
dashedName: step-1
---

# --description--

Anza na boilerplate ya kawaida ya HTML. Ongeza tamko la `DOCTYPE`, kipengele cha `html` kinachobainisha ukurasa huu uko kwa Kiingereza, kipengele cha `head` na kipengele cha `body`.

Ongeza tagi ya `<meta>` yenye `charset` inayofaa na `<meta>` ya mwitikio wa simu ya mkononi ndani ya kipengele cha `head`.

# --hints--

Msimbo wako unapaswa kuwa na rejeleo la `DOCTYPE`.

```js
assert(code.match(/<!DOCTYPE/gi));
```

Unapaswa kujumuisha nafasi baada ya rejeleo la `DOCTYPE`.

```js
assert(code.match(/<!DOCTYPE\s+/gi));
```

Unapaswa kufafanua aina ya hati kuwa `html`.

```js
assert(code.match(/<!DOCTYPE\s+html/gi));
```

Unapaswa kufunga tamko la `DOCTYPE` kwa `>` baada ya aina.

```js
assert(code.match(/<!DOCTYPE\s+html\s*>/gi));
```

Unapaswa kuwa na tagi ya ufunguzi ya `<html>` yenye sifa ya `lang` ya `en`.

```js
assert(code.match(/<html\s+lang\s*=\s*('|")en\1\s*>/gi));
```

Kipengele chako cha `html` kinapaswa kuwa na tagi ya kufunga.

```js
assert(code.match(/<\/html\s*>/));
```

Tamko lako la `DOCTYPE` linapaswa kuwa mwanzoni mwa HTML yako.

```js
assert(__helpers.removeHtmlComments(code).match(/^\s*<!DOCTYPE\s+html\s*>/i));
```

Unapaswa kuwa na tagi ya kufungua ya `<head>`.

```js
assert(code.match(/<head\s*>/i));
```

Unapaswa kuwa na tagi ya kufunga ya `</head>`.

```js
assert(code.match(/<\/head\s*>/i));
```

Unapaswa kuwa na tagi ya kufungua ya `<body>`.

```js
assert(code.match(/<body\s*>/i));
```

Unapaswa kuwa na tagi ya kufunga ya `</body>`.

```js
assert(code.match(/<\/body\s*>/i));
```

Vipengele vya `head` na `body` vinapaswa kuwa ndugu.

```js
assert(document.querySelector('head')?.nextElementSibling?.localName === 'body');
```

Kipengele cha `head` kinafaa kuwa ndani ya kipengele cha `html`.

```js
assert([...document.querySelector('html')?.children].some(x => x?.localName === 'head'));
```

Kipengele cha `body` kinafaa kuwa ndani ya kipengele cha `html`.

```js
assert([...document.querySelector('html')?.children].some(x => x?.localName === 'body'));
```

Unapaswa kuwa na vipengele viwili vya `meta`.

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

Kipengele kimoja cha `meta` kinapaswa kuwa na `name` iliyowekwa kuwa `viewport`, na `content` iliyowekwa kuwa `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') === 'width=device-width, initial-scale=1.0' && !m?.getAttribute('charset'));
assert.exists(target);
```

Kipengele chako cha `meta` kinapaswa kuwa na sifa ya `charset` yenye thamani ya `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--

--fcc-editable-region--
```

```css

```
