9 COMMENTS

  1. because an element with position absolute is placed acording to fisrt ancestor (content+padding) that has position: relative/absolut/fixed/sticky
    so .wrapper is static by default so to place that line acording to it position needs to be changed and relative is the best option because the element stays in the document flow unlike absolute and stays were it's placed

  2. Can you please explain… why you have made
    [.wrapper h2{
    position: relative;] and then again [.wrapper h2::before{
    content: '';
    position: absolute;]

    I am really stuck in these lines . I am a beginner and self learner so your reply would be a great help for me.

LEAVE A REPLY

Please enter your comment!
Please enter your name here