Write a CSS class for all the paragraphs

in only that to appear in blue color and text centered ?

Write a CSS class for all the paragraphs <p> in only that to appear in blue color and text-centered?

Follow three simple steps-

1] Write basic html page skeleton-

<html>
<head>
   <title>Paragraph</title>
  <style type=”text/css”>
  </style>
</head>
<body>
</body>
</html>

2] Create paragraphs tag and attach class 

<p class=”para”>random text random text random text random text random text</p>

 

3] Create inter Internal CSS, attach color attribute and text center attribute

Attach style attribute for-

  • Text center- “text-align:center”
  • Color- “color:blue”

<style type=”text/css”>
      .para
      {
        color: blue;
        text-align: center;
      }
   </style>

 

Final HTML CSS code-

<html>

<head>
  <title>Paragraph</title>
  <style type=”text/css”>
      .para
      {
        color: blue;
        text-align: center;
      }
   </style>
</head>

<body>
       <p class=”para”>random text random text random text random text random text</p>
</body>
</html>

Output-

random text random text random text random text random text