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 = "...style rules....">

The following is an example:

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

Updated on: 30-Jan-2020

222 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements