Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

ySlow recommends at most 3 stylesheets, and with good reason: the HTML headers and request times can drastically slow a site down.

By simply organizing the structure of the file well, you can have a easy to navigate css file. Of course there may be a few extra style sheets; ie.css, section specific.css, print.css and mobile.css.

Here's my CSS file structure:

-reset

-html tags h1,p,q etc

-header

-navigation

-content

-sidebar

-misc (popups, forms, buttons)

-footer



It's generally a good idea to concatenate your stylesheets for production - doesn't mean you have to write them as one big file, though.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: