CSS – Set Border Style for Paragraph
To set a specific border style for Paragraph element using CSS, set border-style property with required value for the selected paragraph elements in styles(inline/external).
Example
In the following HTML script, we have set border style for paragraphs with different values.
index.html
</>
Copy
<!DOCTYPE html>
<html lang="en">
<head>
<style>
p {
border-width: 1px;
}
#p1 {
border-style: solid;
}
#p2 {
border-style: dashed;
}
#p3 {
border-style: dotted;
}
</style>
</head>
<body>
<p>Default paragraph.</p>
<p id="p1">Paragraph 1.</p>
<p id="p2">Paragraph 2.</p>
<p id="p3">Paragraph 3.</p>
</body>
</html>
Conclusion
In this CSS Tutorial, we learned how to set border style for paragraph element(s) using CSS.