fix(curriculum): use `getComputedStyle` to check css value (#48240)
* fix(bug): use getComputedStyle to check css value * Update curriculum/challenges/english/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6148da157cc0bd0d06df5c0a.md Co-authored-by: Shaun Hamilton <shauhami020@gmail.com> Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>pull/48254/head^2
parent
f9a8e11de6
commit
f45cd6543c
|
@ -31,9 +31,10 @@ assert.equal(display, 'inline-block');
|
|||
You should give the `label` element a `text-align` of `right`.
|
||||
|
||||
```js
|
||||
const gs = (s) => new __helpers.CSSHelp(document).getStyle(s)?.textAlign;
|
||||
const textAlign = gs('.info > label') ?? gs('.info label');
|
||||
assert.equal(textAlign, 'right');
|
||||
const v = (el) => getComputedStyle(el).getPropertyValue('text-align');
|
||||
document.querySelectorAll('.info label').forEach(el => {
|
||||
assert.equal(v(el), 'right');
|
||||
});
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
|
Loading…
Reference in New Issue