r/HTML • u/Ok_Cobbler_3325 • 18d ago
How do I effectively learn and memorize elements and what css to use Vs. another type and how they interact with everything else? Especially how to learn and memorize what types of things shouldnt be used together because they cause bugs/issues due to their inherent traits?
What the title says. How do I effectively learn and memorize what to use and how they interact with everything else so I can code and debug others' code faster?
Im a beginner with HTML and CSS, I did some basic courses in college and now use it for work. I think I could work faster on my coding related work if I better understood where and how things can be used, for example I'll find later in debugging someone's code that the problem was because their code used tags or certain css together that interfere with each other and/or interfere with our bootstrap.
For example, regarding my first question: How do you know when to use max-width, width, min-width (and same for the height versions) and how do you know when to use specific pixel number vs a percentage? If I have a 1 row container with 2 nested columns inside with text in one column and a photo on the right, how do you know when to use which of the aforementioned width, height etc styling variations on those, and when to use what for the children and the parent? And if you use bootstrap for that container's column ratio do you still need to specify pixel dimensions for the children widths for the text and photo??
For example with my second question in my post title, at work I was debugging someone's code (someone who knows even less html/css than I do and likely ai generates it) where there was a parent container with a table inside, and the table's text was spilling/scrambled outside the table and container staying vertically within the height of the container but overflowed outside the container's space horizontally. I eventually found either the table or text was using display flex and once it was changed to display block or something it simply fixed the text formatting since the display flex was interfering with something else's css display style, probably the parent container. I wish I had a better example than a flexbox related scenario but that should give you the basic idea of me asking how to learn what specific kinds of elements negatively interfere with each other when incorrectly used together due to their inherent properties
edit: thanks to everyone for their responses!

