mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): add 100% max-width requirement to business card lab (#59556)
This commit is contained in:
+8
@@ -19,6 +19,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab
|
||||
1. You should have a `div` with the `class` `business-card`.
|
||||
1. The `business-card` `class` should be `300px` wide and it should have any background color of your choice. There should be a `padding` of `20px` all around and a top `margin` of `100px`. The text should be center aligned and the font size should be `16px`. The left and right margins should be set to `auto`.
|
||||
1. Inside the `business-card` `div`, there should be an `img` element with the `class` `profile-image`. You can set the image source to `https://cdn.freecodecamp.org/curriculum/labs/flower.jpg` if you like. There should be an `alt` with a meaningful description.
|
||||
1. The `profile-image` selector should have a `max-width` of `100%`.
|
||||
1. Inside the `business-card` `div`, after the `img` element, you should have three `p` elements with the `class` `full-name`, `designation`, and `company`, respectively.
|
||||
1. The first `p` element should contain your name.
|
||||
1. The second `p` element should contain your designation.
|
||||
@@ -160,6 +161,12 @@ The `alt` attribute of the image should be set to a meaningful description.
|
||||
assert.isAbove(document.querySelectorAll('img')[0].alt.length, 0);
|
||||
```
|
||||
|
||||
Your `.profile-image` selector should have a `max-width` of `100%`.
|
||||
|
||||
```js
|
||||
assert.equal(new __helpers.CSSHelp(document).getStyle('.profile-image').getPropVal('max-width'), '100%');
|
||||
```
|
||||
|
||||
Inside the `.business-card` element, after the `img` element, there should be a `p` element with the `class` `full-name`.
|
||||
|
||||
```js
|
||||
@@ -361,6 +368,7 @@ body {
|
||||
}
|
||||
|
||||
.profile-image {
|
||||
max-width: 100%;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
Reference in New Issue
Block a user