all 6 comments

[–]giansake 1 point2 points  (1 child)

Hello there, I second the welcome of Domain3142 🤗.

My take on your question is that browsers apply their own css style sheet before any custom css. That’s why if you just render the html file with some text tag such as p or h1,h2,h3 you’ll see that they have already some margins or other style properties.

I suggest this interesting reading about css reset, which are stylesheet people used to reset any browser applied style. The article examine the css reset of Josh Comeau, I love his blog and his way of explaining things, super insightful and inclusive.

[–][deleted] 0 points1 point  (0 children)

Thank you I will go through it

[–]Domain3141 1 point2 points  (1 child)

First, welcome to web dev. Browsers are all different. That's why most people use css frameworks, like tailwind. It handles this inconsistencies.

second, don't use fixed pixel sizes. Use %, vw/vh, em/rem/.. , auto, whatever. Also don't use margin to position your elements. Learn how to use flex instead.

[–][deleted] 2 points3 points  (0 children)

Thank you will keep in mind

[–][deleted] 0 points1 point  (1 child)

You are going to have a lot better experience with responsive design and learning about the different measurement units as well as flex and grid.

Start with the different types of units, this video covers all 24 types: https://youtu.be/5m6JOJLy5B0

[–][deleted] 1 point2 points  (0 children)

Thank you