这种情况看似很简单,但是我不能处理设置元素。
我所拥有的:
或:
我需要什么
代码: JSFiddle
<div class="container">
<div class="page-header">
<h2>Header</h2>
<div class="btn-group <!-- pull-right -->">
<a class="btn btn-success" href="/Scope/New">Create</a>
<div class="btn-group">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu pre-scrollable" role="menu">
<li class="dropdown-header">Create as copy: </li>
<li><a href="/Scope/New/1">Test 1</a></li>
<li><a href="/Scope/New/2">Test 45</a></li>
<li><a href="/Scope/New/3">Lorem ipsum</a></li>
</ul>
</div>
</div>
</div>
</div>
答案 0 :(得分:1)
将$args = array(
'post_type' => 'product',
'post_status' => 'any',
'orderby' => 'title',
'order' => 'ASC'
);
if ( ! empty( get_queried_object() ) )
{
$args['tax_query'] = array(
array(
'taxonomy' => 'product_categorie',
'field' => 'slug',
'terms' => get_queried_object()->slug
),
);
}
添加到clearfix
page-header
<div class="page-header clearfix">
答案 1 :(得分:1)
在clearfix
中添加page-header
,并将display: inline;
添加到h2
。
这样可以解决您的问题。 (当前h2
已内联添加,您可以将其放在CSS文件中)
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="page-header clearfix
">
<h2 style="display: inline;">Header</h2>
<div class="btn-group <!-- pull-right -->">
<a class="btn btn-success" href="/Scope/New">Create</a>
<div class="btn-group">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu pre-scrollable" role="menu">
<li class="dropdown-header">Create as copy: </li>
<li><a href="/Scope/New/1">Test 1</a></li>
<li><a href="/Scope/New/2">Test 45</a></li>
<li><a href="/Scope/New/3">Lorem ipsum</a></li>
</ul>
</div>
</div>
</div>
</div>
答案 2 :(得分:0)
.page-header {
padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
justify-content: space-between;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="page-header">
<h2>Header</h2>
<div class="btn-group">
<a class="btn btn-success" href="/Scope/New">Create</a>
<div class="btn-group">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu pre-scrollable" role="menu">
<li class="dropdown-header">Create as copy: </li>
<li><a href="/Scope/New/1">Test 1</a></li>
<li><a href="/Scope/New/2">Test 45</a></li>
<li><a href="/Scope/New/3">Lorem ipsum</a></li>
</ul>
</div>
</div>
</div>
</div>
仅此而已,您可以使用flex。