Computer >> Computer tutorials >  >> Programming >> Javascript

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>