Top Menu

I have edited many 3rd party software and others’ templates in the past and obviously my own created applications, and I have seen it all. I have seen CSS in its separate *.css file and included in the HTML page’s header. I have seen styles enclosed in the <style></style> tags and placed in the header, and I have seen styles inline in the HTML tags like <div style=”width: 150px;”></div>

Which style do I prefer? Well, it depends. If I am starting a brand new project, then I set up seprerate assets/ directory with a sub-category css/ and I create a style.css file to include in my application’s header file. However, I seem to quickly drift off to a less conventional inclusion such as styles in the <style></style> tag, and quickly escalating it to inline css. I know it’s bad. I only blame my self for such sloppy code, but if I am in a hurry, and I don’t want to open multiple files and editing code everywhere, I add it inline in one spot and done.

Bad coding, but one day you will learn that maybe laziness/quick edits are ok. Otherwise, always create css files separately. It’s cleaner and much nicer.


About The Author

I write about my life!