Inline CSS Explained!!

Inline CSS Explained:-

Inline CSS allows you to apply a unique style to one HTML element at a time. You assign CSS to a specific HTML tag by using the style attribute with any CSS properties defined within it.
In the following example, you can see how to describe CSS style properties in the same line of code with an HTML <p> tag. We use a style attribute to assign CSS styling properties. In this particular case, color and a value (blue) apply to the HTML <p> element.

Inline CSS:-

  • The inline CSS helps you apply style rules to specific HTML elements.
  • The elements are modified by applying the style attribute.
  • The inline CSS is limited. For elaborate projects, you should consider other options: internal and external methods.  

Example:-

<p style="color: blue;">This is a paragraph.</p>


Code:-


<html>
<head>
<title>Inline CSS Explained</title>
</head>
<body>
<p style="color:blue; font-size:46px;">
it is a paragraph
</p>
</body>
</html>

Post a Comment

1 Comments