CodesJava

Easy learning with example program codes

Inline CSS

The Inline CSS uses the style attribute to apply CSS to a single HTML element.

Example:

<!DOCTYPE html>
<html>
<body>
<h1 style="color:crimson;font-family:cursive;">Hello World!!</h1>
</body>
</html>

Output:

Explanation:

In the above example, we used the style attribute to add CSS to a single HTML element.

Disadvantages of Inline CSS:

  • Within the inline CSS, quotations can be used, because the browser will interpret this as an end of the style value.
  • The inline CSS cannot be reused anywhere else.
  • The inline CSS can not be stored at a single place and so the styles are tough to be edited.
  • Styling of the pseudo-codes and pseudo-classes is not possible with inline CSS.
  • Browser cache advantages are not facilitated by Inline CSS.
Please follow and like us:
error
Posted in CSS   









Copyright © 2019 CodesJava DMCA.com Protection Status