Home » Script and Codes » Add Custom CSS Style For Paragraph

Add Custom CSS Style For Paragraph

How to add custom CSS style for paragraph?

Add Custom CSS Style For Paragraph: The border-style property can have from one to four values (for the top border, right border, bottom border, and the left border).

CSS Code:

p {
  border-bottom: 6px solid red;
  background-color: #EEEEEE;
  padding: 5px 5px 5px 5px;
}

Example 1 with HTML code:

<!DOCTYPE html>
<html>
<head>
<style>
p {
  border-bottom: 6px solid red;
  background-color: #EEEEEE;
  padding: 5px 5px 5px 5px;
}
</style>
</head>
<body>

<p>This property is a shorthand property for border-bottom-width, border-bottom-style, and border-bottom-color.</p>

</body>
</html>

Result:

Example 2 with HTML code:

<!DOCTYPE html>
<html>
<head>
<style>
p {
  border-left: 6px solid Blue;
  background-color: #EEEEEE;
  padding: 10px 10px 10px 10px;
}
</style>
</head>
<body>

<h2>The border-left Property</h2>
<p>This property is a shorthand property for border-left-width, border-left-style, and border-left-color.</p>

</body>
</html>

Result:

Scroll to Top