How to overlay one div over another div

前端 未结 9 1870
旧时难觅i
旧时难觅i 2020-11-21 17:39

I need assistance with overlaying one individual div over another individual div.

My code looks like this:

9条回答
  •  孤独总比滥情好
    2020-11-21 17:57

    I am not much of a coder nor an expert in CSS, but I am still using your idea in my web designs. I have tried different resolutions too:

    #wrapper {
      margin: 0 auto;
      width: 901px;
      height: 100%;
      background-color: #f7f7f7;
      background-image: url(images/wrapperback.gif);
      color: #000;
    }
    #header {
      float: left;
      width: 100.00%;
      height: 122px;
      background-color: #00314e;
      background-image: url(images/header.jpg);
      color: #fff;
    }
    #menu {
      float: left;
      padding-top: 20px;
      margin-left: 495px;
      width: 390px;
      color: #f1f1f1;
    }

    Of course there will be a wrapper around both of them. You can control the location of the menu div which will be displayed within the header div with left margins and top positions. You can also set the div menu to float right if you like.

提交回复
热议问题