+ 1

Need Some Help With CSS

Hello. I cannot understand the CSS code in 38.2 CODE REPO inside the CSS course. I cannot understand the usage of position attribute there. Can you please help me?

4th Jun 2023, 2:25 PM
Amin
10 Antworten
+ 3
You should reread the last lesson carefully.
4th Jun 2023, 2:32 PM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
+ 3
Padding-right is for adding some specific inner-space to the right side of an element.
4th Jun 2023, 2:55 PM
Yasin Rahnaward
Yasin Rahnaward - avatar
+ 2
Css positioning is a big topic, but for example we need to keep a website navigation or side bar in a stable state when scrolling the page, we have to set the header or side bar position to fixed or sticky Value [in order]. the fixed position is implemented in my first answer by blinovKirill code.
4th Jun 2023, 2:45 PM
Yasin Rahnaward
Yasin Rahnaward - avatar
+ 2
Amin we use position to specify the position and behavior of an element as the page is being scrolled. For example we use position and give it a value of fixed accompanied with other properties like top, bottom, left and right so that the stays at the specified position all the time. You have other position values like sticky, relative and absolute. If you want to know what these values do just ask
5th Jun 2023, 9:58 AM
Sobi Mohammed
Sobi Mohammed - avatar
+ 1
Amin we use padding to give space between the content and the boarder of the container. You can specify the direction if you want. Eg padding-left and so on.
5th Jun 2023, 9:51 AM
Sobi Mohammed
Sobi Mohammed - avatar
0
I still cannot understand. Why do we need the position attribute in this case?
4th Jun 2023, 2:36 PM
Amin
0
Hasnain [ACTIVE CHALLENGER] Can you please explain more? I have read it several times.
4th Jun 2023, 2:40 PM
Amin
0
Yasin Rahnaward Why do we need "padding-right" there?
4th Jun 2023, 2:47 PM
Amin
0
Yasin Rahnaward Ok. Why do we need it there?
4th Jun 2023, 2:57 PM
Amin