当我使用php函数时,如何避免div中的换行符。我的代码是HTML是避免在div中换行
<div class="toolbar">
<div style="float:left; ">
Profile <?php get_search_form(); ?>
</div>
</div>
和我的CSS代码是
.toolbar {
background: #F2F2D7;
width: inherit;
font-family: "Palatino";
padding-top: 5px;
padding-bottom: 5px;
position: fixed;
top: 0;
box-shadow: 0px 4px 9px 2px #888888;
z-index:2;
white-space: nowrap;
}
与我取得类似:
<p> Profile </p> <p> Buscador </p>
<p> and what I want is </p>
档案Buscador
如果它是一个预定义函数,我该如何调整结果,类似的事情发生在<?php wp_register(); ?>,它始终包含div标签 – Delfin
您可能必须使用字符串操作来删除/替换不希望包含在结果中的标签。可以为特定位置创建样式,以便在不更改标记的情况下更正这些问题,但这会让您的CSS变得非常臃肿。 –