Check out example codes for "html style attribute". It will help you in understanding the concepts better.

Code Example 1

<style>
  /* Put in CSS */
</style>

Code Example 2

<h1 style="color:blue;text-align:center">This is a header</h1>
<p style="color:green">This is a paragraph.</p>

Code Example 3

<!-- style inside of an html element -->
<p style="color: rgb(255, 0, 255);">I am a unicorn</p>
<!-- style as an html element -->
<style>
  /* Put in CSS */
</style>

Code Example 4

<html>
  <body>
    <!-- BODY HTML -->
  </body>
  <head>
    <!-- HEAD HTML -->
  </head>
  <style>
    /* CSS */
  </style>

Code Example 5

<h1 style="color:blue;">This is a Blue Heading</h1>
<!DOCTYPE html>
<html>
<head>
<style>

 body {background-color: powderblue;}
h1   {color: blue;}
p    {color: red;}

</style>
</head>
<body>

<h1>This is a 
 heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

Learn ReactJs, React Native from akashmittal.com