CSS Disadvantages of Using Inline Styles

By [)ia6l0 iii

Below is a short list of disadvantages of using inline styles

1. You cannot reuse the styles anywhere else.

2. The html markup of the page becomes cumbersome, and tough to parse for the naked eye.

3. Since, they are not stored at a single place, they are tough to be edited

4. This approach does not provide consistency across your application. The inline styles on elements can cause a major headache.

5. It does not provide you with the browser cache advantage. The files are repeatedly downloaded by the client on every request. Instead, consider using External style sheets.

6. Inline styles take precedence over page-level style declarations and external style sheets. So you could accidentally override styles that you did not intend.

7. It's impossible to style pseudo-elements and -classes with inline styles. For example, with external and internal style sheets, you can style the visited, hover, active, and link color of an anchor tag.

Related FAQs

Margins are specified using the margin-top, margin-bottom, margin-left and margin-bottom properties. CSS allows you to specify these properties through a shorthand notation too.
In CSS , we specify the color using the hexadecimal notation: # followed by the six digits.
An inline style is applied through the "Style" attribute to the element.
Padding properties are specified using the Padding-Top, Padding-Bottom , Padding-Left and Padding-Right. CSS allows you to use a shorthand technique to specify these.
You can use apply more than one class to an Element at the same time.
You might use more than one rule through CSS on a single element. In such cases, you might as well like to define the precedence order on the rules.
CSS Disadvantages of Using Inline Styles  (7338 Views)