通过创作罗斯科绘画学习 CSS 盒子模型 - 步骤 11

Tell us what’s happening:

在此详细描述你的问题。
.canvas 元素包装在另一个 div 中。 为 div 赋予 frame 类。

总是回复我: `.canvas` 元素应该嵌套在新的 `div` 元素中。 ### Your code so far
/* file: styles.css */
.canvas {
  width: 500px;
  height: 600px;
  background-color: #4d0f00;
}
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Rothko Painting</title>
    <link href="./styles.css" rel="stylesheet">
  </head>
  <body>

<!-- User Editable Region -->


    <div class="canvas"><div class="frame"><canvas></canvas> </div>
    </div>
    


<!-- User Editable Region -->

  </body>

Your browser information:

用户代理是: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0

Challenge Information:

通过创作罗斯科绘画学习 CSS 盒子模型 - 步骤 11

To start, you correctly had a div element with the class of .frame.

The .canvas element you need is a new div element with the .canvas class.
Do not create a new element called canvas !!!

That means you are supposed to create a new element with a class of .frame.

Then, you move your element with the class of .canvas inside this new element.

<div class="frame">
    <div class="canvas">
    </div>
</div>
1 Like