Should I separate typography section from the HTML hierarchy?

Is it a good practice to make a separate section of CSS rules applying only for typography? or should they be part of the HTML hierarchy flow?

The question is mostly from readability and maintainability point of view.

Answers


In my opinion, it's best practice to keep things modular. Put your CSS in its own file(s), and, if you have a lot of stylings (very common), I'd say you can have a typography.css to make the rules very clear. HTML is supposed to be meaningful (as the purpose of HTML5 is to go back to this idea), and this should extend past the use of tags to the placement of files and readability of your code.

Hope this helps.


Need Your Help

C# - Detect locked files in a directory

c# io

I am looking for a way to watch a directory (and its sub-directories) for locked files i.e. when an application opens a file and locks it, an event should trigger in my app.