CSS p Style | CSS p Tag

CSS p Style

  • CSS p Style means that, you can style your paragraph using CSS Properties.
  • The paragraph element is not appealing without CSS Style.
  • Using CSS Style on the Paragraph than paragraph look and feel will be changed, and that’s why paragraph will look more attractive.
  • You can apply border, margin, color, padding, font-size, latter-spacing and many more styles will be applying on the paragraph.

Example 1- CSS Paragraph Element Designing

<!DOCTYPE html>
<html>
  <head>
    <style>
      p  {
        color: red;
        font-family: courier;
        font-size: 160%;
        border:5px solid green;
         }
    </style>
  </head>
  <body>
    <p>This is a paragraph.</p>
  </body>
</html> 

The above code shows that how can you apply style on a paragraph or p.

CSS p Style or Designing Paragraph Element
Fig.1 CSS p Style Or CSS p Tag-

Basic CSS Properties Apply On The Paragraph

CSS Property Application Example
background-color Change the background color. background-color:black;
text-transform Change the text case to inherit. text-transform: inherit;
letter-spacing Change the text letter spacing. letter-spacing: 4px;
line-height Change the spacing between the lines of para. line-height: 1.6;

CSS Paragraph Style

CSS supports many properties for paragraph style or designing.

Example 2- Advance Properties of CSS which Apply on Paragraph

<!DOCTYPE html>
<html>
  <head>
    <style>
      p
	  {
        text-align: justify;
		line-height: 1.7;
		letter-spacing: 3px;
		text-transform: uppercase;
		background-color: yellow;
	  }
	</style>
  </head>
  <body>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.rit in voluptate velit esse cillum dolore eu fugiat nulla occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
  </body>
</html> 

The above are the some properties which is used to style paragraph.

CSS p Style CSS p Tag Style p
Fig.2 – Example Of CSS paragraph style
You can leave a response, or trackback from your own site.
Leave a Reply to the article


Learn CSS

Learning & Certifications
Follow Us
Facebook Icon   Linked In Icon   Twitter Icon  
Validation and Recognition

Valid CSS! Valid HTML5!          Protected by Copyscape