开发者

Organize class in CSS file

开发者 https://www.devze.com 2023-01-23 07:00 出处:网络
During development a lot of times I need to apply just a small enhance开发者_Go百科ment to an html tag.

During development a lot of times I need to apply just a small enhance开发者_Go百科ment to an html tag. For example : a red border ,or a float left.

The best practice dictate to keep all the code in one/several css files,avoid inline styling and keep ids to a minimum.

So how do I keep organize the css file with so many small groups of properties and how do I remember if I have one already or not. Should I just build a lot of small css classes ? How does this concept apply in a team ?


I have found comments to work best for my use. I usually break up my CSS document by page or display item such as

/* Contact Form */

or

/* About Us Table */

It really comes down to personal preference and coming to an agreement with your other team members on how to document your project.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号