Prologue to Inline CSS
Inline CSS permits you to apply a special style to each HTML component in turn. You allot CSS to a particular HTML component by utilizing the style characteristic with any CSS properties characterized inside it.
In the accompanying model, you can perceive how to depict CSS style properties for an HTML
the component in a similar line of code.
We utilize a style property to relegate CSS styling properties. In this specific case, shading and worth (blue) apply to the HTML
Component.
Inline styles in CSS could be helpful for reviewing changes right away or adding CSS rules to just a couple of components. At the point when you don’t approach your .css record, knowing how inline style CSS works can be helpful.
Ordinarily, CSS is written in a different CSS document (with record expansion .css) or in a
Ordinarily, CSS is written in a different CSS document (with record augmentation .css) or in a tag within the tag, however, there is a third-place that is likewise substantial. The third-place you can compose CSS is within an HTML tag, utilizing the style property. At the point when CSS is composed utilizing the style trait, it’s called an “inline-style”. All in all, this isn’t viewed as a best practice. Nonetheless, there are times when inline styles are the right (or just) decision.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Myprograming</title>
</head>
<body>
<!--------this is inline css---->
<h1 style="color: blue;">Myprograming</h1>
<p style="font-size: 25px;font-weight: 700;">This is Inline CSS</p>
</body>
</html>
Demo:-
Output:-