0

I have created a section and I named it class="sectionOne". Right now this section is empty, but I try to add a background with image and it does not appear there. However, if I add a style in <>. For example .section class="sectionOn" style="background: url();" my image appears, but very small, but if I do it in css it does not appear. I have linked my html file with css, any ideas where's the problem? My path is correct 100%

inspector my structure

.sectionOne {
    background: url(../images/kendall-henderson-Pj6TgpS_Vt4-unsplash.jpg);
    max-width: 100%;
    max-height: 100%;
}
<section class="sectionOne">

</section>
henrbu
  • 1
  • 2
  • Look in the network tab. Your styles and images dir are likely not in parallel – mplungjan Jul 16 '19 at 14:46
  • Is the path correct relative to your CSS file? - what is your directory structure? – Alan Kael Ball Jul 16 '19 at 14:48
  • i updated this post with few photos. Take a look. Also my url is now without "", tried with them - still does not work – henrbu Jul 16 '19 at 14:51
  • 1
    You have no content in your `section` so it has no reason to be anything other than 0 height. Add some content, or set a `height` with a length that's not relative (i.e., not %). See also [Why doesn't height: 100% work to expand divs to the screen height?](https://stackoverflow.com/q/7049875/215552) – Heretic Monkey Jul 16 '19 at 15:34
  • width: 100%; height: 100%;position: fixed; Solved my problem. Ill take a look about content in section, thanks. – henrbu Jul 16 '19 at 15:57

0 Answers0