jquery - Move <a> tag to new line if it's content flows out of the first line? -


i'm trying achieve following, move tag new line if content flow 1 line another, can see mean here http://jsfiddle.net/snyzx/ firs example (red) shows situation have , second example (orange) shows desired effect, without <br> tag. can achieved plain html , css, if not jquery solution well.

<div id="example1">     hi there text , <a href="#"> link! </a> </div>  <div id="example2">     hi there text , <br> <a href="#"> link! </a> </div> 

css:

#example1 {     background: red;     width: 145px; }  #example2 {     background: orange;     width: 145px;     margin-top: 20px; } 

add:

a {     white-space: pre; } 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -