How to use style attribute to define style rules?

You can use style attribute of any HTML element to define style rules. These rules will be applied to that element only. Here is the generic syntax:

<element style = " rules....">

The following is an example:

      <p style = "color:#36C;"> This is inline CSS </p>

Updated on: 30-Jan-2020


Kickstart Your Career

Get certified by completing the course

Get Started