75 lines
1.3 KiB
Markdown
75 lines
1.3 KiB
Markdown
---
|
|
id: 60a3e3396c7b40068ad6997a
|
|
title: Step 17
|
|
challengeType: 0
|
|
dashedName: step-17
|
|
---
|
|
|
|
# --description--
|
|
|
|
Scrivi una nuova regola che seleziona gli elementi `.one` e imposta la sua proprietà `width` a 425 pixel.
|
|
|
|
# --hints--
|
|
|
|
Dovresti avere un selettore `.one`.
|
|
|
|
```js
|
|
const hasOne = new __helpers.CSSHelp(document).getStyle('.one');
|
|
assert(hasOne);
|
|
```
|
|
|
|
Dovresti assegnare alla proprietà `width` il valore `425px`.
|
|
|
|
```js
|
|
const hasWidth = new __helpers.CSSHelp(document).getCSSRules().some(x => x.style.width === '425px');
|
|
assert(hasWidth);
|
|
```
|
|
|
|
L'elemento `.one` dovrebbe avere una proprietà `width` con il valore `425px`.
|
|
|
|
```js
|
|
const oneWidth = new __helpers.CSSHelp(document).getStyle('.one')?.getPropertyValue('width');
|
|
assert(oneWidth === '425px');
|
|
```
|
|
|
|
# --seed--
|
|
|
|
## --seed-contents--
|
|
|
|
```css
|
|
.canvas {
|
|
width: 500px;
|
|
height: 600px;
|
|
background-color: #4d0f00;
|
|
}
|
|
|
|
.frame {
|
|
border: 50px solid black;
|
|
width: 500px;
|
|
padding: 50px;
|
|
margin: 20px auto;
|
|
}
|
|
--fcc-editable-region--
|
|
|
|
--fcc-editable-region--
|
|
|
|
```
|
|
|
|
```html
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Rothko Painting</title>
|
|
<link href="./styles.css" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
<div class="frame">
|
|
<div class="canvas">
|
|
<div class="one"></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
```
|