Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CSS background image are not showing up

Why the css background image not showing up? I checked the image location are correct.

The HTML Code:

<section id="hero-image">
  <h1>paper</h1>
</section>

The CSS Code:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

.hero-image{
    background-image: url(img/Slideshow/slide.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

>Solution :

In your CSS code, try changing the .hero-image to #hero-image. This is because you have defined "hero-image" as an ID. And you use #hero-image when searching for an ID within your HTML.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading