Eguen
October 3, 2022, 2:44pm
1
Please can someone help me check what’s wrong with this code? I’m trying to set the name attribute and the content attribute.
Your code so far
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Colored Markers</title>
</head>
<body>
</body>
</html>
Your browser information:
User Agent is: Mozilla/5.0 (Linux; Android 9; itel W6002E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Mobile Safari/537.36
Challenge: Learn CSS Colors by Building a Set of Colored Markers - Step 5
Link to the challenge:
width=device-width,initial-scale=1.0
width=device-width, initial-scale=1.0
I copied the code to my space and got an error like you so I moved the 2nd meta to its own line then I copied the text exactly of the content tag and was able to pass.
The test seems to want a single space after the comma above.
I opened an issue. The test should not look for whitespace in the string.
opened 04:32PM - 03 Oct 22 UTC
type: bug
scope: curriculum
status: waiting triage
### Describe the Issue
The test is looking for a string with a space in it that… isn't required.
### Affected Page
https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-css-colors-by-building-a-set-of-colored-markers/step-5
### Your code
https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/14-responsive-web-design-22/learn-css-colors-by-building-a-set-of-colored-markers/616965351e74d4689eb6de30.md
> Your new meta element should have a name attribute set to viewport, and a content attribute 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');
assert.exists(target);
```
### Expected behavior
Valid HTML should pass the test.
https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-content
https://infra.spec.whatwg.org/#split-on-commas
### Screenshots
_No response_
### System
- Device: [e.g. iPhone 6, Laptop]
- OS: [e.g. iOS 14, Windows 10, Ubuntu 20.04]
- Browser: [e.g. Chrome, Safari]
- Version: [e.g. 22]
### Additional context
https://forum.freecodecamp.org/t/learn-css-colors-by-building-a-set-of-colored-markers-step-5/559840
1 Like
Eguen
October 5, 2022, 7:33pm
4
Thank you so much for your answer.
Eguen
October 5, 2022, 7:34pm
5
Thank you so much for your suggestion.