Can I put a background image in a section?

1

I created a section in my HTML and in the CSS I put:

section{
    background-image: url(../img/bkg2.jpg);
}

But the image does not appear. And I checked the path and it's correct.

    
asked by anonymous 24.02.2018 / 14:54

2 answers

0
header#cabecalho {
    border-bottom: 1px #606060 solid;
    height: 150px;
    background: url("../_imagens/glass-logo-peq.jpg") no-repeat 0px 80px;
}

Hello, maybe assign an id to a specific area of your section help.

I hope I have helped! = D.

    
24.02.2018 / 16:22
0

Absolutely!

    section {
    	background-image: url("https://static.pexels.com/photos/294674/pexels-photo-294674.jpeg");
        width: 100%;
        height: 500px;
    }
<section></section>

The image appears, but the problem is in the dimensions of your section!

I recommend not using CSS generalizing elements like this, use Class and ID . For all its sections will be the same.

    
24.02.2018 / 16:08