Re:Show HN: I wrote a book about Debugging CSS
by nicoburns on Saturday December 12, 2020 @12:10PM
(#25399712)
CSS debugging heuristic #1: 9 times out of 10 it's a `position: relative` or `overflow: hidden` you need.
[ Parent
| on HN ]
Re:Show HN: I wrote a book about Debugging CSS
by ImpressiveWebs on Saturday December 12, 2020 @07:39PM
(#25403206)
Not true at all, especially in modern CSS. Position relative is only needed for using absolute positioning. That should be extremely rare.
And overflow: hidden is an old workaround for float-based layouts that should never be used in 2020 unless you’re debugging a legacy project. And even in that case, you should be using a proper clearfix instead.
Re:Show HN: I wrote a book about Debugging CSS
by willio58 on Sunday December 13, 2020 @09:03PM
(#25412702)
Woah there.
Position relative can help with z-index issues.
Also, I’ve never dealt with float based layouts but I can tell you overflow hidden is useful outside of that context.
Re:Show HN: I wrote a book about Debugging CSS
by ImpressiveWebs on Monday December 14, 2020 @04:56AM
(#25415208)
Again, z-index is so rarely used and if you needed overflow hidden for something other than floats, then you were doing your CSS wrong. I’m not saying that to be arrogant, I’ve written books on CSS and written articles for some of the biggest web dev sites online. It’s just true that many developers don’t understand CSS and often use the wrong tool for the right job, so to speak.
Re:Show HN: I wrote a book about Debugging CSS
by Kagerjay on Sunday December 13, 2020 @12:10PM
(#25408053)
`position: relative`, and `position: absolute` imo is the source of so many responsive web design CSS bugs
always use flexbox first before position relative
Re:Show HN: I wrote a book about Debugging CSS
by commandlinefan on Saturday December 12, 2020 @08:15PM
(#25403392)
*: border 1px red
Re:Show HN: I wrote a book about Debugging CSS
by runawaybottle on Saturday December 12, 2020 @04:11PM
(#25401750)
Low key pro tip.