如果div出现在另一个div之上,即使它出现在HTML之前,我怎样才能得到div。
如果你看下面的例子,我们需要在最前面出现logo div。
div
{
height: 200px;
width: 200px;
background: #0f0;
}
.parent
{
position: relative;
z-index: 1;
}
.child
{
position: fixed;
z-index: 2;
top: 70px;
left: 30px;
background: #f00;
height: 60px;
}
.child-2
{
position: inherit;
z-index: 6;
top: 10px;
left: 30px;
background: blue;
height: 60px;
}

<div class="parent">
header background repeated image
<div class="child-2">
logo
</div>
</div>
<div class="child">
hero image
</div>
&#13;
答案 0 :(得分:1)
您无需将Schema::create('companies', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->string('companyName');
$table->string('logo')->nullable();
$table->string('contactPerson');
$table->string('employeeSize');
...
Schema::create('jobs', function (Blueprint $table) {
$table->increments('id');
$table->integer('company_id');
$table->string('jobTitle');
$table->longText('jobDescription');
$table->longText('jobRequirement');
$table->date('deadline');
...
提供给其他区块
只需将它标记为徽标即可。
z-index
div {
height: 200px;
width: 200px;
background: #0f0;
}
.parent {
position: relative;
}
.child {
position: fixed;
top: 70px;
left: 30px;
background: #f00;
height: 60px;
}
.child-2 {
position: inherit;
z-index: 16;
top: 10px;
left: 30px;
background: blue;
height: 60px;
}