Inline Style Sheet Advantages:
Inline CSS can be used for many purposes, some of which include:
- Testing: Many web designers use Inline CSS when they begin working on new projects, this is because it’s easier to scroll up in the source, rather than change the source file.
- Quick-fixes: There are times where we would just apply a direct fix in your HTML source, using the style attribute, but you would usually move the fix to the relevant files when we are either able, or got the time.
- Smaller Websites: The website such as Blogs where there are only limited number of pages, using of Inline CSS helps users and service provider.
- Lower the HTTP Requests: The major benefit of using Inline CSS is lower HTTP Requests which means the website loads faster than External CSS.
- It is ideal for situations when the style is to be applied only on single element within the entire webpage.
- It has the highest priority from all the methods available for applying stylesheets.
- Overriding: Because they are the most specific in the cascade, they can over-ride things you didn’t intend them to.
- Every Element: Inline styles must be applied to every element you want them on. So if we want all your paragraphs to have the font family “Arial” we have to add an inline style to each tag in our document. This adds both maintenance work for the designer and download time for the reader.
- Pseudo-elements: It’s impossible to style pseudo-elements and classes with inline styles. For example, with external and internal style sheets, we can style the visited, hover, active, and link color of an anchor tag. But with an inline style all we can style is the link itself, because that’s what the style attribute is attached to.
- It cannot be used to apply styles on multiple web pages at once.
- Also same inline property cannot apply to multiple occurrences of that element in a webpage.