html - 如何将我的 Logo 从左侧移开 18 像素?

标签 html css image web margin

我网站的 Logo 应该位于页面的左上角。确实如此,但现在它离左侧有点太近了。我想将它向右移动 18px。但我无法让它移动。我试图为我的 Logo 制作一个“.content img”,但它没有用。有什么想法吗?

      .content {
        position: absolute;
        width: 100%;
        min-height: 100%;
        z-index: 1000;
        background-color: rgba(0,0,0,0.7);
      }
      .content h1 {
        text-align: center;
        font-size: 80px;
        text-transform: uppercase;
        font-weight: 300;
        color: #fff;
        padding-top: 4.5%;
        margin-bottom: 10px;
      }
      .content p {
        text-align: center;
        font-size: 20px;
        letter-spacing: 3px;
        color: #aaa;
      }

      .contect img {
        margin-left: 18px;
      }
<!DOCTYPE html>
<html>

<head>

  <script src = "jquery-3.1.1.min.js"></script>

  <script src = "script.js"></script>

  <link rel = "stylesheet" href="style.css">

  <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

  <link href="https://fonts.googleapis.com/css?family=Open+Sans|Passion+One|Source+Code+Pro" rel="stylesheet">

  <title> AL-SABA.net </title>

</head>

<body>

<header>

    <div class = "content"> 
                          <img src = "logo6.png" /> 

                          <h1> Title </h1>
                          <p>Design • Code • Programs </p>
    </div>

</header>

 		 <link href='http://fonts.googleapis.com/css?family=Varela+Round' rel = 'stylesheet' type = 'text/css'>

    <div class="background-wrap">
      <video id="video-bg-elem" preload="auto" autoplay="true" loop="loop" muted="muted"> 
        <source src="coding.mp4" type="video/mp4">
        Video not supported
      </video>          
    </div>

<div class="arrow bounce">
</div>

<footer>
</footer>

</body>

</html>

最佳答案

您的代码有一个拼写错误,上面写着“.contect img”。试试这个:

.content img {
    margin-left: 18px;
}

关于html - 如何将我的 Logo 从左侧移开 18 像素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41784610/

相关文章:

html - 缺少任何 HTML 结束标记时的 Jsoup 行为

javascript - 用星号屏蔽用户输入

html - 更改双列表框中单击选项的背景颜色

Android:为什么使用图像按钮?

PHP 搜索并替换 img src

wordpress - WordPress 在哪里存储图像元数据?

html - 没有在 <head> 标签中插入 google 字体链接,但我仍然可以使用 Roboto?

javascript - 用于触摸设备的简单 Javascript

html - 如何为外部div内的div提供自动宽度?

html - 如何在同一行上获得此 'a' 链接和 'input' 按钮? CSS