html - text underline for full text -
i want create line below multi-line block of text length of longest line of text in block. want achieve that:
`lorem ipsum, lorem ipsum, lorem ipsum =========================----------------`
example did far http://jsfiddle.net/vhdyf/82/
if open using jquery could...
get width of
span
append
hr
of widthstyle
hr
needed
$(function() { $('span').each(function() { var w = $(this).width(); var l = $('<hr />'); l.css("width", w); $(this).append(l); }); });
span { position: relative; display: inline; padding-bottom: 2px; } hr { width: 50px; margin-left: 0; border: 2px solid #000; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div> <span>lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, </span> </div> <br/> <br/> <div> <span>lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, lorem ipsum, loremipsumloremipsumloremipsum, lorem ipsum, lorem ipsum, lorem ipsum, </span> </div> <br/> <br/> <div style="display:block;width:300px;"> <span>lorem ipsum, lorem ipsum, loremhkjhkasdasdffasfasfasfjhjkipsum, </span> </div>
Comments
Post a Comment