its redundant to add height to your container, its height is set by the content, likewise its redundant to use it in your top bar, you should just add padding to its content as it will always be 100% of its content, unless specified
Hi Chris, as I explain in the video, I set the height to 100% because I tend to use flexbox a lot, and to have a vertical alignment on parent elements with fixed height, like a topbar or hero section, you need your container to grow with the parent element. Regarding your second point, using paddings would not be the correct approach because I would have to set the same paddings to all other sections of the page in order to have the left and right alignment, this would cause unnecessary code repetition. The container is set only once for all screen dimensions and I can use it many times throughout the page.
@@dawebschools even with flexbox declaring a height to any layout element is redundant...you would only be applying padding to the top and bottom, reduce your code with multiple variables, eg padding:1rem auto; or if you are only gonna use left and right padding theres different ways ways to do it, padding: 0 auto; or padding-inline:auto, as long as you are within your container then you write less code
Nice and easy to follow, good explanation of why and how it works. Looking forward to more tutorials.
thanx alot this video is proven to be very helpful for specially begineers
I watched many tutorial but this is awesome
thanks
its redundant to add height to your container, its height is set by the content, likewise its redundant to use it in your top bar, you should just add padding to its content as it will always be 100% of its content, unless specified
Hi Chris, as I explain in the video, I set the height to 100% because I tend to use flexbox a lot, and to have a vertical alignment on parent elements with fixed height, like a topbar or hero section, you need your container to grow with the parent element. Regarding your second point, using paddings would not be the correct approach because I would have to set the same paddings to all other sections of the page in order to have the left and right alignment, this would cause unnecessary code repetition. The container is set only once for all screen dimensions and I can use it many times throughout the page.
@@dawebschools even with flexbox declaring a height to any layout element is redundant...you would only be applying padding to the top and bottom, reduce your code with multiple variables, eg padding:1rem auto; or if you are only gonna use left and right padding theres different ways ways to do it, padding: 0 auto; or padding-inline:auto, as long as you are within your container then you write less code
You can do this without nesting container divs inside other divs. Simply apply a 4% padding to the outer div and don't bother with the inner div.
Media queries in 2024?
Hi Alex, what would you suggest?
Try search "css no media queries" for good start. It will help.
please i need download link or the jpeg of the apple wrist watch
thanks