Skip to content

Commit

Permalink
Answered Q45 (#2010)
Browse files Browse the repository at this point in the history
* Answered Q45

```
position: absolute;
An element with position: absolute; is positioned relative to the nearest positioned ancestor (instead of positioned relative to the viewport, like fixed).

However; if an absolute positioned element has no positioned ancestors, it uses the document body, and moves along with page scrolling.
```
Source: https://www.w3schools.com/css/css_positioning.asp

* Update front-end-development-quiz.md

Co-authored-by: Zhenja <evg.bazhanov@yahoo.com>
  • Loading branch information
AbhiBiju and Ebazhanov authored Aug 2, 2021
1 parent 07faf82 commit 6185c89
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions front-end-development/front-end-development-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,16 +429,20 @@ console.log(currencies);
- [ ] `<input type="radio" value="vanilla" on>`


#### Q45. _____ moves an element completely out of the page's normal layout flow, like it is sitting on its own separate layer. From there, you can fix it in a position relative to the edges of the page's <html> element (or its nearest positioned ancestor element)?
#### Q45. _____ moves an element completely out of the page's normal layout flow, like it is sitting on its own separate layer. From there, you can fix it in a position relative to the edges of the page's `<html>` element (or its nearest positioned ancestor element)?

- [ ] Sticky positioning
- [ ] Absolute positioning
- [x] Absolute positioning
- [ ] Relative positioning
- [ ] Fixed positioning

#### Q46. You have created a box that has a height set with CSS. Which line of CSS would add scroll bars if the content is taller than the box, but leave no visible scroll bars if the content fits into the box?

[Source: W3Schools](https://www.w3schools.com/css/css_positioning.asp)

**position: absolute;**
`An element with position: absolute; is positioned relative to the nearest positioned ancestor (instead of positioned relative to the viewport, like fixed).
However; if an absolute positioned element has no positioned ancestors, it uses the document body, and moves along with page scrolling.`

#### Q46. You have created a box that has a height set with CSS. Which line of CSS would add scroll bars if the content is taller than the box, but leave no visible scroll bars if the content fits into the box?

- [ ] .box { overflow: scroll; }
- [ ] .box { overflow: scroll-x; }
Expand Down

0 comments on commit 6185c89

Please sign in to comment.