* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2.1 KiB
2.1 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
id | title | challengeType | videoUrl | forumTopicId | dashedName |
---|---|---|---|---|---|
5a94fe2669fb03452672e45e | 使用 grid-area 创建区域模板 | 0 | https://scrimba.com/p/pByETK/c6N7VhK | 301135 | use-grid-area-without-creating-an-areas-template |
--description--
我们在上一次挑战中学到的 grid-area
属性还有另一种使用方式。如果网格中没有定义区域模板,你也可以像这样为它添加一个模板:
item1 { grid-area: 1/1/2/4; }
这里使用了你之前学习的网格线编号来定义网格项的区域。上例中数字代表这些值:
grid-area: 起始的水平网格线 / 起始的垂直网格线 / 结束的水平网格线 / 结束的垂直网格线;
因此,示例中的网格项将占用第 1 条水平网格线(起始)和第 2 条水平网格线(终止)之间的行,及第 1 条垂直网格线(起始)和第 4 条垂直网格线(终止)之间的列。
--instructions--
请用 grid-area
属性将 class
为 item5
的元素放置在第 3 条和第 4 条水平网格线,以及第 1 条和第 4 条垂直网格线之间的区域内。
--hints--
class
为 item5
的元素应具有 grid-area
属性且属性值应为 3/1/4/4
。
assert(
code.match(
/.item5\s*?{[\s\S]*grid-area\s*?:\s*?3\s*?\/\s*?1\s*?\/\s*?4\s*?\/\s*?4\s*?;[\s\S]*}/gi
)
);
--seed--
--seed-contents--
<style>
.item1{background:LightSkyBlue;}
.item2{background:LightSalmon;}
.item3{background:PaleTurquoise;}
.item4{background:LightPink;}
.item5 {
background: PaleGreen;
/* Only change code below this line */
/* Only change code above this line */
}
.container {
font-size: 40px;
min-height: 300px;
width: 100%;
background: LightGray;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr;
grid-gap: 10px;
}
</style>
<div class="container">
<div class="item1">1</div>
<div class="item2">2</div>
<div class="item3">3</div>
<div class="item4">4</div>
<div class="item5">5</div>
</div>
--solutions--
<style>.item5 {grid-area: 3/1/4/4;}</style>