SaurabhLP SaurabhLP - 1 year ago 95
CSS Question

Horizontal Line in Background using Css3

How to implement this type of style to text using only css3, means a horizontal line in the middle of the tag... Can it be possible using pure css...

enter image description here

Here's my structure:-

<p class="datedAside">4 weeks ago</p>

Answer Source

Here's one way to do it by adding a span inside the p.


<p class="datedAside"> <span> 4 weeks ago </span> </p>​


p {background: #000; height:1px; margin-top:10px;}
p span{background: #fff; padding:10px; position:relative; top:-10px; left: 20px}​


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download