私は次のことを達成しようとしています。コンテンツがある行から別の行に流れる場合はタグを新しい行に移動します。したがって、ここで私が何を意味するかを確認できますhttp://jsfiddle.net/sNyzX/最初の例 (赤) は状況を示しています私は今、2番目の例(オレンジ)は望ましい効果を示していますが、その<br>
タグはありません。これはプレーンな html と css で実現できますか? そうでない場合は、jQuery ソリューションでも同様に実現できます。
<div id="example1">
Hi there This is some text and <a href="#"> this is the link! </a>
</div>
<div id="example2">
Hi there This is some text and <br> <a href="#"> this is the link! </a>
</div>
CSS:
#example1 {
background: red;
width: 145px;
}
#example2 {
background: orange;
width: 145px;
margin-top: 20px;
}