mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-19 13:00:51 -04:00
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>
This commit is contained in:
@@ -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--
|
||||
|
||||
Reference in New Issue
Block a user