curriculum/challenges/english/blocks/top-learn-css-foundations-projects/63ee3ff1381756f9716727f2.md
With this exercise, we've provided you a completed HTML file, so you will only have to edit the CSS file. For this exercise, it's more important to understand how chaining different selectors works than how to actually add the attributes.
width of 300px on the avatar and proportioned class.avatar and distorted classes a width of 200px.height twice as big as it's width.You should have a width of 300px on the avatar and proportioned class.
const style = new __helpers.CSSHelp(document).getStyle(`.avatar.proportioned`) || new __helpers.CSSHelp(document).getStyle(`.proportioned.avatar`);
assert(style?.width === '300px');
You should have a height of auto on the avatar and proportioned class.
const style = new __helpers.CSSHelp(document).getStyle(`.avatar.proportioned`) || new __helpers.CSSHelp(document).getStyle(`.proportioned.avatar`)
assert(style?.height === 'auto');
You should use a chaining selector on the avatar and proportioned class.
const style = new __helpers.CSSHelp(document).getStyle(`.avatar.proportioned`) || new __helpers.CSSHelp(document).getStyle(`.proportioned.avatar`);
assert(style);
You should have a width of 200px on the avatar and distorted class.
const style = new __helpers.CSSHelp(document).getStyle(`.avatar.distorted`) || new __helpers.CSSHelp(document).getStyle(`.distorted.avatar`);
assert(style?.width === '200px');
You should use a chaining selector on the avatar and distorted class.
const style = new __helpers.CSSHelp(document).getStyle(`.avatar.distorted`) || new __helpers.CSSHelp(document).getStyle(`.distorted.avatar`);
assert(style);
You should have a height two times the width on the avatar and distorted class.
const style = new __helpers.CSSHelp(document).getStyle(`.avatar.distorted`) || new __helpers.CSSHelp(document).getStyle(`.distorted.avatar`);
assert(style?.height === '400px');
<!DOCTYPE html>
<html lang="en">
<head>
<title>Chaining Selectors</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Use the classes BELOW this line -->
<div>
</div>
<!-- Use the classes ABOVE this line -->
<div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Chaining Selectors</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Use the classes BELOW this line -->
<div>
</div>
<!-- Use the classes ABOVE this line -->
<div>
</body>
</html>
.avatar.proportioned {
height: auto;
width: 300px;
}
.avatar.distorted {
height: 400px;
width: 200px;
}