What is Inline Style ?
- Inline styles are styles that are written directly in the tag on the document.
- Inline styles affect only the tag they are applied to.
- Avoid Using Inline Styling it is most worst style of writing CSS.
- We can assign style attribute to the HTML element and directly specify the properties and values to Element without actually defining the rule.
Complete Example of Inline Styling :
<html>
<head></head>
<body>
<h1>This is H1 Heading Without Style</h1>
<h1style="color:blue;margin-left:60px">
This is a H1 Heading.
</h1>
<h2style="color:red;margin-left:60px">
This is a H2 Heading.
</h2>
<h3style="color:black;margin-left:60px">
This is a H3 Heading.
</h3>
<h4style="color:cyan;margin-left:60px">
This is a H4 Heading.
</h4>
<h5style="color:green;margin-left:60px">
This is a H5 Heading.
</h5>
</body>
</html>
Output :
