I am building a website in Html and CSS. Currently I have a small problem where I am struggling to place a border below text like in the image below. Here’s my code in Html
<div class="Sectionheading"> <h1>LegalPractice Area</h1> </div>
2
You can use the horizontal row tag to get the output you are looking for:
<hr style="width:10%;text-align:center">
For reference check this page out: https://www.w3schools.com/tags/tag_hr.asp
Try this:
.Sectionheading{ text-align:center; } h1{ padding-bottom: 25px; position:relative; } h1:before { content: " "; width: 60px; height: 5px; position: absolute; margin: 0 auto; left: 0; right: 0; bottom: 0; background: #ff9700; }
Click here to cancel reply.
2
Answers
You can use the horizontal row tag to get the output you are looking for:
For reference check this page out: https://www.w3schools.com/tags/tag_hr.asp
Try this: