HTML div bg颜色和内容

时间:2016-05-27 09:56:49

标签: html css

我一直试图在我的网站上放一张背景图片,因为我的div类"标题"工作不正常。这是代码。任何人都可以解释为什么会这样吗?当向下滚动网站时,div标题和img循环应该卡在页面顶部。编辑:身体上的其他结束标记导致所有模糊。



 body {
      background-color: #ffffcc;
      margin: 0;
      padding: 0;
    }
  }
  .header {
    height: 100px;
    width: 100%;
    background-color: #006600;
    margin-top: -1.5%;
    overflow: auto;
    position: fixed;
  }
  .img-circular {
    width: 200px;
    height: 200px;
    background-image: url(../images/stareLogo.jpg);
    background-size: cover;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    margin-left: 45%;
    margin-right: 45%;
    overflow: auto;
    position: fixed;
  }
  .main {
    clear: both;
  }

<!DOCTYPE html>
<html lang="pl">
<html>
<head>
  <meta charset="UTF-8" />
  <meta name="description" content="Roto-car topowy szczeciński warsztat samochodowy">
  <meta name="keywords" content="warsztat,szczecin,serwis,samochód,samochodowy,car,repair,fix,naprawa,samochodu,auto">
  <meta name="author" content="Dominik Leszczenko">
  <link rel="stylesheet" href="css/stylesheet.css" />
  <title>Roto-car - Szczeciński warsztat samochodowy</title>
</head>

<body>
  <header>
    <div class="header"></div>
    <div class="img-circular"></div>
  </header>
  <div class="main">
    <h1>Roto-car</h1>
    <hr>
    <p>Szczeciński warsztat samochodowy</p>
  </div>
</body>

</html>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:1)

您是否希望实现此类解决方案:

save
$currentusage = $currentusage + 1;
$savecurrentusage = new CurrentPercentageModel;
$savecurrentusage->current_usage = $currentusage;
$savecurrentusage->save();

答案 1 :(得分:1)

只需设置标题最小高度并为其提供背景颜色,然后您将看到标题。在风格上你应该给标题而不是 .header