html - 我希望我的页眉框阴影覆盖正文部分的顶部

标签 html css box-shadow

我正在为教程构建我的作品集,但我遇到了一些问题

'box-shadow' 和 'header'。我希望 box-shadow 覆盖标题,就像侧边栏覆盖城市图像背景一样 我很抱歉粗心的发帖。我会在下一个问题中做得更好! 感谢您的帮助!!

我仍然无法附上我的图片有问题。请点击此链接并查看我的代码笔:https://codepen.io/cjddlr1/pen/YNzPmK

<div class="header" style="box-shadow : 0 3px 15px black;">
</div>

<div class="body">
  <div class="row">
    <div class="col-xs-2" id="sidebar-left"></div>
    <div class="col-xs-8" id="contents-section">
      <div class="row" id="section1">
        <div class="col-xs-4" id="myPicCol">
          <img src="http://www.sanviator.com/app/images/logoapple.png" alt="logopic.png" id="myPicture"/>
        </div>
        <div class="col-xs-8">
          <div class="section1">
            <h1>Full-Stack Developer</h1>
            <h3>My name is Chung Ik Yu.</h3>
            <p>Currently living in Jinju, South Korea.</p>
            <p>I'm training my front-end web development skills nowadays.</p>
            <p>my final goal is emigrating to Canada using my skills and Making A lot of Money to help people around me</p>
          </div>
        </div>
      </div>
      <div class="row" id="section2">
        <div class="col-xs-12">
          <h2>SKILLS</h2>
          <ul>
            <li>HTML/CSS/BOOTSTRAP : LOW-MID</li>
            <li>PHP : LOW</li>
            <li>Javascript : MID</li>
            <li>jQuery : LOW</li>
          </ul>
        </div>
      </div>
      <div class="row" id="section3">
        <div class="col-xs-1"></div>
        <div class="col-xs-10">
          <h1>Contact</h1>
          <div class="row">
            <div class="col-xs-6">
              <p>PHONE : 010-xxxx-xxxx</p>
            </div>
            <div class="col-xs-6">
              <p>E-MAIL : cjddlr1@coldmail.com</p>
            </div>
          </div>
        </div>
        <div class="col-xs-1"></div>
      </div>
    </div>
    <div class="col-xs-2" id="sidebar-right"></div>
  </div>
</div>

.header{
  height :50px;
  overflow-x : hidden;
  background-color:gray;
  position : relative;
}
.body {
  min-height : 100%;
  overflow-x : hidden;
  background-image : url('http://calgaryattractions.com/wp-content/uploads/calgary01.jpg');
  background-size : cover;
}
.footer {
  position: relative;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50px;
  background : gray;
  box-shadow : 0px -3px 15px black;
  overflow-x : hidden;
}
#myPicCol {
  align : center;
}
#myPicture {
  height : 205px;
  display: block;
  margin-left : 80px;
}
#contents-section {
  background : white;
}
#section1 {
  padding : 30px 0 30px 0;
}
#section2 {
  padding : 30px 0 30px 95px;
}
#section2 li {
  margin-left : -10px;
}
#section3 {
  padding : 30px 0 30px 0;
}
#section3 .col-xs-6 {
  text-align : center;
}
#section3 h1 {
  text-align : center;
}
#sidebar-left{
}
#sidebar-right {
}
ul {
  list-style-type: none;
}

最佳答案

添加z-index: 1;

在你的.header

阴影将笼罩一切。

关于html - 我希望我的页眉框阴影覆盖正文部分的顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41842076/

相关文章:

javascript - 重定向到 PDF 下载的新页面

html - 水平 100% 菜单但垂直子菜单项

html - IE 上的 webkit 动画

html - 让包含不同字体大小的文本的多个 div 都对齐到底部的方法?

html - 带有背景图片的导航上的 CSS 投影

html - 使用 css 创建自定义箭头形状

javascript - 粘性菜单 - 在某些页面上隐藏但在其他页面上不隐藏

html - Bootstrap 导航栏右侧的语言选择器

css - 从 Angular Material <mat-chip> 中移除 box-shadow

html - 如何将 box-shadow 添加到::after 当 after if 是一个三 Angular 形时?