Some thoughts from one with experience, rather than a 'purist':

Storing all styles, for a large application, in one CSS file is not maintainable. You'll have perform a text search of the file to find the style you're looking for, or scroll a lot, and there's a higher chance that you'll overlook related styles when making an update.

If certain styles are particular to a page, not globally used, it is more maintainable to keep them in a style tag within the head tag.

Deep CSS inheritance hierarchies are also not maintainable. These are much, much worse than inline styles! The CSS language itself does a poor job of applying styles to many elements in more complex structures. Consider lesscss, sass, or even jQuery for more than basic application of styles.

Lots of developers use HTML for presentation, mostly DIVs, when they think they are doing the right thing, or lecturing others. Some example above!

Answer from Paul on Stack Overflow
🌐
W3Schools
w3schools.com › html › html_css.asp
HTML Styles CSS
An inline CSS is used to apply a unique style to a single HTML element.
🌐
Codecademy
codecademy.com › article › html-inline-styles
Inline Styles in HTML: When to Use | Codecademy
The third place you can write CSS is inside of an HTML tag, using the style attribute. When CSS is written using the style attribute, it’s called an “inline style”. In general, this is not considered a best practice.
Discussions

asp.net - Inline styles vs styles in CSS - Stack Overflow
I know placing all your styles in a CSS file is the best thing to do as it is a lot neater. But does it REALLY matter if the styles are inline or in a CSS????? Edit below My plan is to just pla... More on stackoverflow.com
🌐 stackoverflow.com
css - What's the difference between inline styles vs classes? - Stack Overflow
In my head, I've always known to use classes over inline styles for any project. But are there any effective differences between the two? More on stackoverflow.com
🌐 stackoverflow.com
Are you really *never* supposed to use inline styles?
Like a lot of things in software development it really just comes down to consistency being king. Inline styles are convenient, but once you have a page that's even a little complex you start wanting actual selectors in a stylesheet. It becomes really hard to maintain your css when it's mixed all over multiple files, so people just recommend keeping all your css in a stylesheet. When you're using inline styles in Javascript (i.e. React), the story is a little different since you can swap your inline styles using Javascript. And even then some people (myself included) prefer just using a stylesheet and classnames. More on reddit.com
🌐 r/css
31
8
April 13, 2023
Inline CSS vs Classes vs IDs - Styling (CSS) - Pinegrow Community Forum
Hello, Because Pinegrow and coding with it is still quite new to me, I wanted to ask the following simple question: What is the best / common way to work with inline CSS / classes / IDs? When I want to use a style on several objects, I use classes. But often I style objects that only appear ... More on forum.pinegrow.com
🌐 forum.pinegrow.com
0
March 13, 2021
People also ask

Q1. Can inline CSS be overridden by other styles?
Yes. Although inline CSS has the highest specificity, it can still be overridden by styles marked with !important in internal or external CSS. For example, a rule like p { color: red !important; } in an external stylesheet will override inline styles.
🌐
intellipaat.com
intellipaat.com › home › blog › inline css: how to use the style attribute?
Inline CSS: How to Use the Style Attribute?
Q3. When should you avoid using inline CSS?
Avoid inline CSS when building large projects or responsive websites. Inline styles make it difficult to manage, reuse, and apply consistent design changes across multiple pages. External CSS is a better choice for scalability.
🌐
intellipaat.com
intellipaat.com › home › blog › inline css: how to use the style attribute?
Inline CSS: How to Use the Style Attribute?
Q4. Can you use JavaScript to modify inline CSS dynamically?
Yes. You can change inline styles using JavaScript by accessing the style property of an element.
🌐
intellipaat.com
intellipaat.com › home › blog › inline css: how to use the style attribute?
Inline CSS: How to Use the Style Attribute?
🌐
freeCodeCamp
freecodecamp.org › news › inline-style-in-html
Inline Style in HTML – CSS Inline Styles
November 7, 2024 - ... The style attribute works in ... We use style, followed by the equality sign (=), and then a quote where all of the style values will be stored using the standard CSS property-value pairs - "property: value;"....
🌐
W3Schools
w3schools.com › css › css_howto.asp
How to add CSS
CSS Reference CSS Selectors CSS Combinators CSS Pseudo-classes CSS Pseudo-elements CSS At-rules CSS Functions CSS Reference Aural CSS Web Safe Fonts CSS Animatable CSS Units CSS PX-EM Converter CSS Colors CSS Color Values CSS Default Values CSS Browser Support ... When a browser reads a style sheet, it will format the HTML document according to the information in the style sheet.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › display
display - CSS | MDN
3 days ago - The element generates a block box for the content and a separate list-item inline box. A single value of list-item will cause the element to behave like a list item. This can be used together with list-style-type and list-style-position.
Find elsewhere
Top answer
1 of 11
3

Some thoughts from one with experience, rather than a 'purist':

Storing all styles, for a large application, in one CSS file is not maintainable. You'll have perform a text search of the file to find the style you're looking for, or scroll a lot, and there's a higher chance that you'll overlook related styles when making an update.

If certain styles are particular to a page, not globally used, it is more maintainable to keep them in a style tag within the head tag.

Deep CSS inheritance hierarchies are also not maintainable. These are much, much worse than inline styles! The CSS language itself does a poor job of applying styles to many elements in more complex structures. Consider lesscss, sass, or even jQuery for more than basic application of styles.

Lots of developers use HTML for presentation, mostly DIVs, when they think they are doing the right thing, or lecturing others. Some example above!

2 of 11
2

Using Inline CSS:

  • Repeat the same rule for every element in the page.
  • More code and bigger file size to transfer to the client.
  • Harder to maintain, suppose you want to change the width to 200px, you will need to go through all the page and edit one by one.

inline:

<div style="width:100px; height:100px;"></div>
<div style="width:100px; height:100px;"></div>

external OR put css classes in the head [embedded styling]:

<div class="big"></div>
<div class="big"></div>

Based on your edit: that seems not to be inline CSS as in my example above, it is the same idea as using an external file, so if you want to do that go ahead, it is the same.

🌐
BitDegree
bitdegree.org › learn › inline-css
Inline CSS Explained: Learn to Add Inline CSS Style
September 4, 2016 - In this particular case, color and value (blue) apply to the HTML <p> element. ... Inline styles in CSS could be useful for previewing changes instantly or adding CSS rules to only one or two elements.
🌐
Mimo
mimo.org › glossary › html › inline-style
HTML Inline Style Attribute: Syntax, Usage, and Examples
Apply quick styles directly to HTML elements with the style attribute! Learn how to use inline CSS for text, backgrounds, borders, and dynamic styling with JavaScript.
🌐
Simplilearn
simplilearn.com › home › resources › software development › know all about inline css
Inline CSS Guide - How to use Inline Styles | Simplilearn
November 18, 2025 - Inline CSS is the technique to define the single element with the insert style sheets in an HTML document. Understand various concepts of CSS Inline using several example.
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
Code Institute
codeinstitute.net › blog › coding › inline styles in html
Inline Styles in HTML - Code Institute Global
October 26, 2022 - The attribute begins with style and then utilises double quotes (“”) to contain the attribute’s value before ending with an equals sign (“”). A semicolon ‘;’ marks the sentence’s conclusion before the closing tag is applied. However, unlike normal CSS, curly braces and selectors are not used when it comes to inline CSS.
Top answer
1 of 11
42

First of all:

  • If the HTML is built or generated independent of the overall site design (e.g. shared template code), then add reasonably-named classes and IDs, linked exclusively to external stylesheet(s). Use sufficient elements to allow for arbitrary CSS manipulation. For example, see the CSS Zen Garden. This applies to ALL CMSes, programs, scripts, and other dynamically-generated site content. The HTML output must contain absolutely no styling or layout of any sort at all. No exceptions.

Assuming you're dealing with static content, then:

  • If there's any way you can reuse the style, make it a class and link to a stylesheet.

  • If there's no way would ever reuse the style (it's a one-off thing that doesn't make sense anywhere else) then use a <style> block that references the element's #id.

  • If the CSS attribute only makes sense in the context of the surrounding HTML (e.g. some usages of clear:) then I inline the style into the element.

A lot of people call this heresy, just like a lot of people denounce any use of goto in modern programming languages.

However, rather than subscribing to stylistic dogma, my view is you should choose the method based on your circumstances that decreases your overall workload the most. Stylesheets add a level of indirection that makes site-level changes easy and helps build consistency. But if you have several dozen classes on each page that are only used in one place, then you're actually increasing your workload, not decreasing it.

In other words, don't do something dumb and confusing just because people tell you it's the right way to do it.

2 of 11
34

There is a simple reason. The point of CSS is to separate the content (HTML) from the presentation (CSS). It's all about accessibility and code reuse.

🌐
Reddit
reddit.com › r/css › are you really *never* supposed to use inline styles?
r/css on Reddit: Are you really *never* supposed to use inline styles?
April 13, 2023 -

I am relatively new to CSS. I understand the rationale for not needlessly cluttering your HTML with constant, repeated styles. Like, if I have a bazillion elements that need a set of shared values, okay, great, I'll make a class. Or, if I have an element that needs a bazillion styles, I'll make a class.

The part that frustrates me is when I have, for example, some random <p> tag that just needs a different color. Should I really be writing some crap like this:

.someclass .anotherclass > p { color: salmon; }

in order to target that ultra-specific <p> tag, or should I just chuck that color inline, i.e. <p style="color: salmon;"> and forget about it? Because the latter is definitely more convenient.

🌐
NIELIT
nielit.gov.in › gorakhpur › sites › default › files › Gorakhpur › OLEVEL_1_WPD_24mar_IL.pdf pdf
Inline CSS Multiple Style Sheets - Gorakhpur
Inline CSS · An inline style may be used to apply a unique style for a single element. To use inline styles, add the style attribute to the relevant element. The style attribute · can contain any CSS property.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › css tutorial › css inline style
CSS Inline Style | How does CSS Inline Style Work with Examples?
June 8, 2023 - Internal CSS is included in the same HTML page, as it is used for styling the elements used in the code. ... Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more. In Inline style CSS, we style a particular element of the HTML code.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
GeeksforGeeks
geeksforgeeks.org › css › inline-css
Inline CSS - GeeksforGeeks
Inline CSS applies styles directly to HTML elements using the style attribute, allowing for quick, unique styling without external stylesheets.
Published   January 7, 2025
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Reference › Elements › style
<style>: The Style Information element - HTML | MDN
December 15, 2025 - The <style> HTML element contains ... p { color: #26b72b; } code { font-weight: bold; } </style> <p> This text will be green. Inline styles take precedence over CSS included externally....
🌐
Hostinger
hostinger.com › home › tutorials › types of css: inline, external and internal definitions and differences explained
Types of CSS: Inline, Internal and External CSS Explained
April 23, 2025 - Inline CSS styles are included within the HTML document and are specific to individual HTML elements, allowing for targeted styling. Internal CSS styles are included within the head section of an HTML document and apply to the entire document, ...
🌐
Intellipaat
intellipaat.com › home › blog › inline css: how to use the style attribute?
Inline CSS: How to Use the Style Attribute?
November 12, 2025 - We have discussed the difference between the three in detail in the later sections. HTML inline CSS is defined as the way to add CSS styles directly to an HTML element by using the style attribute.
🌐
Pinegrow Community
forum.pinegrow.com › styling (css)
Inline CSS vs Classes vs IDs - Styling (CSS) - Pinegrow Community Forum
March 13, 2021 - Hello, Because Pinegrow and coding with it is still quite new to me, I wanted to ask the following simple question: What is the best / common way to work with inline CSS / classes / IDs? When I want to use a style on several objects, I use classes. But often I style objects that only appear ...