Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 覆盖背景图像_Html_Background Image - Fatal编程技术网

Html 覆盖背景图像

Html 覆盖背景图像,html,background-image,Html,Background Image,我在css文件中定义了一个图像。我想在html中覆盖它 文件css .wrapper.style3 { background-attachment: fixed; background-image: url("../images/overlay.png"), url("../images/banner.jpg"); background-position: center center; background-size: co

我在css文件中定义了一个图像。我想在html中覆盖它

文件css

    .wrapper.style3 {
        background-attachment: fixed;
        background-image: url("../images/overlay.png"), url("../images/banner.jpg");
        background-position: center center;
        background-size: cover;
    }
文件html

    <section id="four" class="wrapper style3 special">
      <div class="container">
         <header class="major">
            <h2>Aenean elementum ligula</h2>
            <p>Feugiat sed lorem ipsum magna</p>
         </header>
         <ul class="actions">
           <li><a href="#" class="button special big">Get in touch</a></li>
         </ul>
      </div>
    </section>

舌骨元素
封建主义者


我想更改html文件中的“banner.jpg”图像。

使用内联样式,
style='background-image:url(…),url(…)'


舌骨元素
封建主义者

<section id="four" class="wrapper style3 special" style="background-image: url(...), url(...)">
  <div class="container">
     <header class="major">
        <h2>Aenean elementum ligula</h2>
        <p>Feugiat sed lorem ipsum magna</p>
     </header>
     <ul class="actions">
       <li><a href="#" class="button special big">Get in touch</a></li>
     </ul>
  </div>
</section>