Full screen image background on header

前端 未结 1 784
感动是毒
感动是毒 2021-01-28 06:14

I want to make website layout with css and Bootstrap.

I have tried with Foundataion FW and I got what I want. But, when I switch to Bootstrap and use same code like befo

相关标签:
1条回答
  • 2021-01-28 06:46

    I have a solution for you.

    problem 1)
    What I did is I added a <img> below the first div (so the div with the class intro). The img has a clas of bg.

    Than add this css:

    .bg{
      position:absolute;
      z-index:-1;
      width:100%;
      height:100%;
    }
    

    here you have a working fiddle. I added a lot of <br> tags to show you it works.

    You can also try to set the background image height:100% and width:auto;. If you do this the image won't be so crammed together on some screens.

    problem 2)
    I Gave every slide a class slide1. I also added to all the slide classes position:relative;. Taka a look at this fiddle.

    i hope your question is now anwsered. If you have other problems, feel free to ask.

    0 讨论(0)
提交回复
热议问题