One of the great benefits of moving all of your styles to the stylesheet is maintainability. Finding inline styles can be a huge pain for other people trying to maintain your code.
For this reason, itβs worth it alone to assign an identifier to a particular element and define its styles in the stylesheet.
Secondly, if you find yourself writing a lot of inline styles, you can probably factor more of these styles using CSS inheritance properties or a few well-equipped classes in addition to the ID.
Performance, identifier selection is as fast as CSS, so using a large number of classes is actually slower than drilling with identifiers, even if only in microseconds.
The only real time that I think it is advisable to use inline styles is very fast properties, such as animation using javascript or hiding and displaying an element (although this can be done with classes).
Gabriel Hurley
source share