[英]Attach one div to the right of another div, but flow to the next line
[英]Is it possible, to flow a div container right next to the last line of a p?
我正在创建一个WordPress模板。 我正在使用the_content(); 将文本写在后端。 WordPress通常将其包装在<p>
。 在the_content();之后; 我想要一个链接(该链接未写入所见即所得编辑器),并且该链接位于div中。 现在,我希望<div>
在p换行文本旁边流动:
<p>
Lorem ipsum dolor坐着,坐立不安,sed diam nonumy eirmod tempor invidunt ut Labore et dolore magna,sed diam。 </p>
<div>
我的链接</div>
谢谢!
我无法正确理解您的问题,但我认为您的意思是
.inline { display: inline; }
<div> <p class="inline">Content is here</p> <div class="inline"><a href="">The link</a></div> </div>
您可以使用CSS display:inline和display:inline-block来做到这一点
使用内联块
<p style="display: inline-block;"> Content of p tag </p> <div style="display: inline-block;"> <a href="#">Content of div tag </a></div>
使用内联:
<p style="display: inline;"> Content of p tag </p> <div style="display: inline;"> <a href="#">Content of div tag </a></div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.