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! I would appreciate it if you comment and tell me how life is treating you? :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">