CSS comments aren’t always helpful, they tend to muddle the code and once you get good at naming classes and ids your CSS should tell a pretty clear story. But one thing that should always be clearly commented is the use of overflow: hidden;
This rule is used mostly for a couple of reasons, and almost never to actually hide overflowing content. The first is to make sure that and element containing floating elements will clear itself. The other is to make sure that an element next to a float doesn’t wrap under that float.
If in your CSS file you clearly comment every time you use overflow: hidden you will be able to read your CSS much faster when you come back to it later. You will also almost certainly find all the unnecessary overflow: hidden; rules you have and it will help you get a much better overall understanding of your layout philosophy.
Submit a Comment