curriculum/challenges/english/blocks/workshop-city-skyline/5d822fd413a79914d39e98cc.md
Welcome to the CSS Variables Skyline project! Start by adding a link element that links your styles.css file within the head element.
Your code should have a link element.
assert.isNotNull(document.querySelector('link'));
You should not change your existing head tags. Make sure you did not delete the closing tag.
const headElements = document.querySelectorAll('head');
assert.strictEqual(headElements?.length, 1);
You should have one void link element.
assert.lengthOf(document.querySelectorAll('link'), 1);
Your link element should be within your head element.
const headContentRegex = /(?<=<head\s*>)[\S|\s]*(?=<\/head\s*>)/;
const headElementContent = code.match(headContentRegex);
const headElement = document.createElement("head");
headElement.innerHTML = headElementContent;
assert.isNotNull(headElement.querySelector('link'));
Your link element should have a rel attribute with the value stylesheet.
const linkElement = document.querySelector('link');
const rel = linkElement?.getAttribute("rel");
assert.strictEqual(rel, "stylesheet");
Your link element should have an href attribute with the value styles.css.
const linkElement = document.querySelector('link');
assert.strictEqual(linkElement?.dataset.href, "styles.css");
<!DOCTYPE html>
<html lang="en">
--fcc-editable-region--
<head>
<meta charset="UTF-8">
<title>City Skyline</title>
</head>
--fcc-editable-region--
<body>
</body>
</html>