Dropdown menu not working after placing another div











up vote
2
down vote

favorite












Before i placed the div class "hero", the dropdown menu works well but after i placed the div class "hero", the dropdown menu did not work anymore. please help me I am new to html and css. thank you.






body {
margin: 0;
}

.here {
list-style-type: none;
margin: 0px;
padding: 0px;
}

.menu .here .choice {
float: right;
width: 200px;
height: 40px;
display: inline;
border: 3px;
background-color: orange;
opacity: .8;
line-height: 40px;
text-align: center;
font-size: 20px;
}

.here .heh {
text-decoration: none;
color: white;
display: block;
}

.here .heh:hover {
background-color: green;
}

.subs {
text-decoration: none;
background-color: orange;
display: none;
color: white;
}

.subs:hover {
background-color: green;
}

.choice:hover .subs {
display: block;
}

.hero {
position: absolute;
width: 100%;
margin-left: 0;
margin-top: 0;
}

.hero .head1 {
color: black;
text-transform: uppercase;
font-size: 70px;
text-align: center;
margin-top: 270px;
font-family: bodoni;
}

.hero .head3 {
text-align: center;
font-family: helvetica;
}

<head>
<link rel="stylesheet" href="one.css">
<link rel="stylesheet" href="two.css">
<meta charset="UTF-8">
<title>Document</title>
</head>

<body>
<div class="menu">
<ul class="here">
<li class="choice"><a href="" class="heh">About</a>
<ul class="here">
<li><a href="" class="subs">You</a></li>
<li><a href="http://www.facebook.com" class="subs">Me</a> </li>
<li><a href="" class="subs">Us</a></li>

</ul>

</li>
<li class="choice"><a href="" class="heh">Contact Us</a></li>
<li class="choice"><a href="" class="heh">Sign Up</a></li>
<li class="choice"><a href="" class="heh">Log in</a></li>

</ul>


</div>

<div class="hero">
<h1 class="head1">something.com</h1>
<h3 class="head3">this is a random sentence.</h3>

</div>

</body>





These code works whenever I eliminate the second div which is the "hero" class. But I don't know what happened here. I need your help.










share|improve this question




























    up vote
    2
    down vote

    favorite












    Before i placed the div class "hero", the dropdown menu works well but after i placed the div class "hero", the dropdown menu did not work anymore. please help me I am new to html and css. thank you.






    body {
    margin: 0;
    }

    .here {
    list-style-type: none;
    margin: 0px;
    padding: 0px;
    }

    .menu .here .choice {
    float: right;
    width: 200px;
    height: 40px;
    display: inline;
    border: 3px;
    background-color: orange;
    opacity: .8;
    line-height: 40px;
    text-align: center;
    font-size: 20px;
    }

    .here .heh {
    text-decoration: none;
    color: white;
    display: block;
    }

    .here .heh:hover {
    background-color: green;
    }

    .subs {
    text-decoration: none;
    background-color: orange;
    display: none;
    color: white;
    }

    .subs:hover {
    background-color: green;
    }

    .choice:hover .subs {
    display: block;
    }

    .hero {
    position: absolute;
    width: 100%;
    margin-left: 0;
    margin-top: 0;
    }

    .hero .head1 {
    color: black;
    text-transform: uppercase;
    font-size: 70px;
    text-align: center;
    margin-top: 270px;
    font-family: bodoni;
    }

    .hero .head3 {
    text-align: center;
    font-family: helvetica;
    }

    <head>
    <link rel="stylesheet" href="one.css">
    <link rel="stylesheet" href="two.css">
    <meta charset="UTF-8">
    <title>Document</title>
    </head>

    <body>
    <div class="menu">
    <ul class="here">
    <li class="choice"><a href="" class="heh">About</a>
    <ul class="here">
    <li><a href="" class="subs">You</a></li>
    <li><a href="http://www.facebook.com" class="subs">Me</a> </li>
    <li><a href="" class="subs">Us</a></li>

    </ul>

    </li>
    <li class="choice"><a href="" class="heh">Contact Us</a></li>
    <li class="choice"><a href="" class="heh">Sign Up</a></li>
    <li class="choice"><a href="" class="heh">Log in</a></li>

    </ul>


    </div>

    <div class="hero">
    <h1 class="head1">something.com</h1>
    <h3 class="head3">this is a random sentence.</h3>

    </div>

    </body>





    These code works whenever I eliminate the second div which is the "hero" class. But I don't know what happened here. I need your help.










    share|improve this question


























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      Before i placed the div class "hero", the dropdown menu works well but after i placed the div class "hero", the dropdown menu did not work anymore. please help me I am new to html and css. thank you.






      body {
      margin: 0;
      }

      .here {
      list-style-type: none;
      margin: 0px;
      padding: 0px;
      }

      .menu .here .choice {
      float: right;
      width: 200px;
      height: 40px;
      display: inline;
      border: 3px;
      background-color: orange;
      opacity: .8;
      line-height: 40px;
      text-align: center;
      font-size: 20px;
      }

      .here .heh {
      text-decoration: none;
      color: white;
      display: block;
      }

      .here .heh:hover {
      background-color: green;
      }

      .subs {
      text-decoration: none;
      background-color: orange;
      display: none;
      color: white;
      }

      .subs:hover {
      background-color: green;
      }

      .choice:hover .subs {
      display: block;
      }

      .hero {
      position: absolute;
      width: 100%;
      margin-left: 0;
      margin-top: 0;
      }

      .hero .head1 {
      color: black;
      text-transform: uppercase;
      font-size: 70px;
      text-align: center;
      margin-top: 270px;
      font-family: bodoni;
      }

      .hero .head3 {
      text-align: center;
      font-family: helvetica;
      }

      <head>
      <link rel="stylesheet" href="one.css">
      <link rel="stylesheet" href="two.css">
      <meta charset="UTF-8">
      <title>Document</title>
      </head>

      <body>
      <div class="menu">
      <ul class="here">
      <li class="choice"><a href="" class="heh">About</a>
      <ul class="here">
      <li><a href="" class="subs">You</a></li>
      <li><a href="http://www.facebook.com" class="subs">Me</a> </li>
      <li><a href="" class="subs">Us</a></li>

      </ul>

      </li>
      <li class="choice"><a href="" class="heh">Contact Us</a></li>
      <li class="choice"><a href="" class="heh">Sign Up</a></li>
      <li class="choice"><a href="" class="heh">Log in</a></li>

      </ul>


      </div>

      <div class="hero">
      <h1 class="head1">something.com</h1>
      <h3 class="head3">this is a random sentence.</h3>

      </div>

      </body>





      These code works whenever I eliminate the second div which is the "hero" class. But I don't know what happened here. I need your help.










      share|improve this question















      Before i placed the div class "hero", the dropdown menu works well but after i placed the div class "hero", the dropdown menu did not work anymore. please help me I am new to html and css. thank you.






      body {
      margin: 0;
      }

      .here {
      list-style-type: none;
      margin: 0px;
      padding: 0px;
      }

      .menu .here .choice {
      float: right;
      width: 200px;
      height: 40px;
      display: inline;
      border: 3px;
      background-color: orange;
      opacity: .8;
      line-height: 40px;
      text-align: center;
      font-size: 20px;
      }

      .here .heh {
      text-decoration: none;
      color: white;
      display: block;
      }

      .here .heh:hover {
      background-color: green;
      }

      .subs {
      text-decoration: none;
      background-color: orange;
      display: none;
      color: white;
      }

      .subs:hover {
      background-color: green;
      }

      .choice:hover .subs {
      display: block;
      }

      .hero {
      position: absolute;
      width: 100%;
      margin-left: 0;
      margin-top: 0;
      }

      .hero .head1 {
      color: black;
      text-transform: uppercase;
      font-size: 70px;
      text-align: center;
      margin-top: 270px;
      font-family: bodoni;
      }

      .hero .head3 {
      text-align: center;
      font-family: helvetica;
      }

      <head>
      <link rel="stylesheet" href="one.css">
      <link rel="stylesheet" href="two.css">
      <meta charset="UTF-8">
      <title>Document</title>
      </head>

      <body>
      <div class="menu">
      <ul class="here">
      <li class="choice"><a href="" class="heh">About</a>
      <ul class="here">
      <li><a href="" class="subs">You</a></li>
      <li><a href="http://www.facebook.com" class="subs">Me</a> </li>
      <li><a href="" class="subs">Us</a></li>

      </ul>

      </li>
      <li class="choice"><a href="" class="heh">Contact Us</a></li>
      <li class="choice"><a href="" class="heh">Sign Up</a></li>
      <li class="choice"><a href="" class="heh">Log in</a></li>

      </ul>


      </div>

      <div class="hero">
      <h1 class="head1">something.com</h1>
      <h3 class="head3">this is a random sentence.</h3>

      </div>

      </body>





      These code works whenever I eliminate the second div which is the "hero" class. But I don't know what happened here. I need your help.






      body {
      margin: 0;
      }

      .here {
      list-style-type: none;
      margin: 0px;
      padding: 0px;
      }

      .menu .here .choice {
      float: right;
      width: 200px;
      height: 40px;
      display: inline;
      border: 3px;
      background-color: orange;
      opacity: .8;
      line-height: 40px;
      text-align: center;
      font-size: 20px;
      }

      .here .heh {
      text-decoration: none;
      color: white;
      display: block;
      }

      .here .heh:hover {
      background-color: green;
      }

      .subs {
      text-decoration: none;
      background-color: orange;
      display: none;
      color: white;
      }

      .subs:hover {
      background-color: green;
      }

      .choice:hover .subs {
      display: block;
      }

      .hero {
      position: absolute;
      width: 100%;
      margin-left: 0;
      margin-top: 0;
      }

      .hero .head1 {
      color: black;
      text-transform: uppercase;
      font-size: 70px;
      text-align: center;
      margin-top: 270px;
      font-family: bodoni;
      }

      .hero .head3 {
      text-align: center;
      font-family: helvetica;
      }

      <head>
      <link rel="stylesheet" href="one.css">
      <link rel="stylesheet" href="two.css">
      <meta charset="UTF-8">
      <title>Document</title>
      </head>

      <body>
      <div class="menu">
      <ul class="here">
      <li class="choice"><a href="" class="heh">About</a>
      <ul class="here">
      <li><a href="" class="subs">You</a></li>
      <li><a href="http://www.facebook.com" class="subs">Me</a> </li>
      <li><a href="" class="subs">Us</a></li>

      </ul>

      </li>
      <li class="choice"><a href="" class="heh">Contact Us</a></li>
      <li class="choice"><a href="" class="heh">Sign Up</a></li>
      <li class="choice"><a href="" class="heh">Log in</a></li>

      </ul>


      </div>

      <div class="hero">
      <h1 class="head1">something.com</h1>
      <h3 class="head3">this is a random sentence.</h3>

      </div>

      </body>





      body {
      margin: 0;
      }

      .here {
      list-style-type: none;
      margin: 0px;
      padding: 0px;
      }

      .menu .here .choice {
      float: right;
      width: 200px;
      height: 40px;
      display: inline;
      border: 3px;
      background-color: orange;
      opacity: .8;
      line-height: 40px;
      text-align: center;
      font-size: 20px;
      }

      .here .heh {
      text-decoration: none;
      color: white;
      display: block;
      }

      .here .heh:hover {
      background-color: green;
      }

      .subs {
      text-decoration: none;
      background-color: orange;
      display: none;
      color: white;
      }

      .subs:hover {
      background-color: green;
      }

      .choice:hover .subs {
      display: block;
      }

      .hero {
      position: absolute;
      width: 100%;
      margin-left: 0;
      margin-top: 0;
      }

      .hero .head1 {
      color: black;
      text-transform: uppercase;
      font-size: 70px;
      text-align: center;
      margin-top: 270px;
      font-family: bodoni;
      }

      .hero .head3 {
      text-align: center;
      font-family: helvetica;
      }

      <head>
      <link rel="stylesheet" href="one.css">
      <link rel="stylesheet" href="two.css">
      <meta charset="UTF-8">
      <title>Document</title>
      </head>

      <body>
      <div class="menu">
      <ul class="here">
      <li class="choice"><a href="" class="heh">About</a>
      <ul class="here">
      <li><a href="" class="subs">You</a></li>
      <li><a href="http://www.facebook.com" class="subs">Me</a> </li>
      <li><a href="" class="subs">Us</a></li>

      </ul>

      </li>
      <li class="choice"><a href="" class="heh">Contact Us</a></li>
      <li class="choice"><a href="" class="heh">Sign Up</a></li>
      <li class="choice"><a href="" class="heh">Log in</a></li>

      </ul>


      </div>

      <div class="hero">
      <h1 class="head1">something.com</h1>
      <h3 class="head3">this is a random sentence.</h3>

      </div>

      </body>






      html css






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 17 hours ago









      Smollet777

      654414




      654414










      asked 18 hours ago









      Karl Philipp Sy Fabre

      7310




      7310
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          The .hero element is on top of your menu. You can check it by using the dev tools of your browser and hovering over the element. You will see, that it expands over the menu and covers it, even though you can see it visually. You can add something like this:



          .hero {
          pointer-events:none;
          }


          That way you can access elements beneath .hero.
          Another solution is to add a negative z-index to the element, which stacks it behind the menu and makes it accessible again






          share|improve this answer




























            up vote
            0
            down vote













            You can add position:relative div above absolute div and need to change some menu css






            body{
            margin: 0;
            }

            .here,.hereinner{
            list-style-type: none;
            margin:0px;
            padding:0px;

            }



            .menu .here .choice{
            float: right;
            display: inline;
            border: 3px;
            background-color: orange;
            opacity: .8;
            line-height: 40px;
            text-align: center;
            font-size: 20px;

            }

            .hereinner li{
            background-color: orange;
            opacity: 1;
            line-height: 40px;
            text-align: center;
            font-size: 20px;

            }

            .here .heh,.subs{
            width: 200px;
            height: 40px;
            text-decoration: none;
            color: white;
            display: block;
            }

            .here .heh:hover{
            background-color: green;
            }

            .hereinner{
            display: none;
            }

            .subs{
            text-decoration: none;
            background-color: orange;
            color: white;
            }

            .subs:hover{
            background-color: green;
            }

            .choice:hover .hereinner{
            display: block;
            }
            .clearfix{
            clear:both;
            }
            .posrel{
            position:relative;
            }

            .hero{
            position: absolute;
            width: 100%;
            margin-left: 0;
            margin-top: 0;
            }

            .hero .head1{
            color: black;
            text-transform: uppercase;
            font-size: 70px;
            text-align: center;
            margin-top: 270px;
            font-family: bodoni;
            }

            .hero .head3{
            text-align: center;
            font-family: helvetica;
            }

            <div class="menu">
            <ul class="here">
            <li class="choice" ><a href="" class="heh">About</a>
            <ul class="hereinner">
            <li ><a href="" class="subs">You</a></li>
            <li ><a href="http://www.facebook.com" class="subs">Me</a> </li>
            <li><a href="" class="subs">Us</a></li>

            </ul>

            </li>
            <li class="choice"><a href="" class="heh">Contact Us</a></li>
            <li class="choice"><a href="" class="heh">Sign Up</a></li>
            <li class="choice"><a href="" class="heh">Log in</a></li>

            </ul>
            <div class="clearfix">

            </div>


            </div>
            <div class="posrel">
            <div class="hero">
            <h1 class="head1">something.com</h1>
            <h3 class="head3">this is a random sentence.</h3>

            </div>

            </div>








            share|improve this answer





















              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370933%2fdropdown-menu-not-working-after-placing-another-div%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote



              accepted










              The .hero element is on top of your menu. You can check it by using the dev tools of your browser and hovering over the element. You will see, that it expands over the menu and covers it, even though you can see it visually. You can add something like this:



              .hero {
              pointer-events:none;
              }


              That way you can access elements beneath .hero.
              Another solution is to add a negative z-index to the element, which stacks it behind the menu and makes it accessible again






              share|improve this answer

























                up vote
                1
                down vote



                accepted










                The .hero element is on top of your menu. You can check it by using the dev tools of your browser and hovering over the element. You will see, that it expands over the menu and covers it, even though you can see it visually. You can add something like this:



                .hero {
                pointer-events:none;
                }


                That way you can access elements beneath .hero.
                Another solution is to add a negative z-index to the element, which stacks it behind the menu and makes it accessible again






                share|improve this answer























                  up vote
                  1
                  down vote



                  accepted







                  up vote
                  1
                  down vote



                  accepted






                  The .hero element is on top of your menu. You can check it by using the dev tools of your browser and hovering over the element. You will see, that it expands over the menu and covers it, even though you can see it visually. You can add something like this:



                  .hero {
                  pointer-events:none;
                  }


                  That way you can access elements beneath .hero.
                  Another solution is to add a negative z-index to the element, which stacks it behind the menu and makes it accessible again






                  share|improve this answer












                  The .hero element is on top of your menu. You can check it by using the dev tools of your browser and hovering over the element. You will see, that it expands over the menu and covers it, even though you can see it visually. You can add something like this:



                  .hero {
                  pointer-events:none;
                  }


                  That way you can access elements beneath .hero.
                  Another solution is to add a negative z-index to the element, which stacks it behind the menu and makes it accessible again







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 18 hours ago









                  Michael

                  1749




                  1749
























                      up vote
                      0
                      down vote













                      You can add position:relative div above absolute div and need to change some menu css






                      body{
                      margin: 0;
                      }

                      .here,.hereinner{
                      list-style-type: none;
                      margin:0px;
                      padding:0px;

                      }



                      .menu .here .choice{
                      float: right;
                      display: inline;
                      border: 3px;
                      background-color: orange;
                      opacity: .8;
                      line-height: 40px;
                      text-align: center;
                      font-size: 20px;

                      }

                      .hereinner li{
                      background-color: orange;
                      opacity: 1;
                      line-height: 40px;
                      text-align: center;
                      font-size: 20px;

                      }

                      .here .heh,.subs{
                      width: 200px;
                      height: 40px;
                      text-decoration: none;
                      color: white;
                      display: block;
                      }

                      .here .heh:hover{
                      background-color: green;
                      }

                      .hereinner{
                      display: none;
                      }

                      .subs{
                      text-decoration: none;
                      background-color: orange;
                      color: white;
                      }

                      .subs:hover{
                      background-color: green;
                      }

                      .choice:hover .hereinner{
                      display: block;
                      }
                      .clearfix{
                      clear:both;
                      }
                      .posrel{
                      position:relative;
                      }

                      .hero{
                      position: absolute;
                      width: 100%;
                      margin-left: 0;
                      margin-top: 0;
                      }

                      .hero .head1{
                      color: black;
                      text-transform: uppercase;
                      font-size: 70px;
                      text-align: center;
                      margin-top: 270px;
                      font-family: bodoni;
                      }

                      .hero .head3{
                      text-align: center;
                      font-family: helvetica;
                      }

                      <div class="menu">
                      <ul class="here">
                      <li class="choice" ><a href="" class="heh">About</a>
                      <ul class="hereinner">
                      <li ><a href="" class="subs">You</a></li>
                      <li ><a href="http://www.facebook.com" class="subs">Me</a> </li>
                      <li><a href="" class="subs">Us</a></li>

                      </ul>

                      </li>
                      <li class="choice"><a href="" class="heh">Contact Us</a></li>
                      <li class="choice"><a href="" class="heh">Sign Up</a></li>
                      <li class="choice"><a href="" class="heh">Log in</a></li>

                      </ul>
                      <div class="clearfix">

                      </div>


                      </div>
                      <div class="posrel">
                      <div class="hero">
                      <h1 class="head1">something.com</h1>
                      <h3 class="head3">this is a random sentence.</h3>

                      </div>

                      </div>








                      share|improve this answer

























                        up vote
                        0
                        down vote













                        You can add position:relative div above absolute div and need to change some menu css






                        body{
                        margin: 0;
                        }

                        .here,.hereinner{
                        list-style-type: none;
                        margin:0px;
                        padding:0px;

                        }



                        .menu .here .choice{
                        float: right;
                        display: inline;
                        border: 3px;
                        background-color: orange;
                        opacity: .8;
                        line-height: 40px;
                        text-align: center;
                        font-size: 20px;

                        }

                        .hereinner li{
                        background-color: orange;
                        opacity: 1;
                        line-height: 40px;
                        text-align: center;
                        font-size: 20px;

                        }

                        .here .heh,.subs{
                        width: 200px;
                        height: 40px;
                        text-decoration: none;
                        color: white;
                        display: block;
                        }

                        .here .heh:hover{
                        background-color: green;
                        }

                        .hereinner{
                        display: none;
                        }

                        .subs{
                        text-decoration: none;
                        background-color: orange;
                        color: white;
                        }

                        .subs:hover{
                        background-color: green;
                        }

                        .choice:hover .hereinner{
                        display: block;
                        }
                        .clearfix{
                        clear:both;
                        }
                        .posrel{
                        position:relative;
                        }

                        .hero{
                        position: absolute;
                        width: 100%;
                        margin-left: 0;
                        margin-top: 0;
                        }

                        .hero .head1{
                        color: black;
                        text-transform: uppercase;
                        font-size: 70px;
                        text-align: center;
                        margin-top: 270px;
                        font-family: bodoni;
                        }

                        .hero .head3{
                        text-align: center;
                        font-family: helvetica;
                        }

                        <div class="menu">
                        <ul class="here">
                        <li class="choice" ><a href="" class="heh">About</a>
                        <ul class="hereinner">
                        <li ><a href="" class="subs">You</a></li>
                        <li ><a href="http://www.facebook.com" class="subs">Me</a> </li>
                        <li><a href="" class="subs">Us</a></li>

                        </ul>

                        </li>
                        <li class="choice"><a href="" class="heh">Contact Us</a></li>
                        <li class="choice"><a href="" class="heh">Sign Up</a></li>
                        <li class="choice"><a href="" class="heh">Log in</a></li>

                        </ul>
                        <div class="clearfix">

                        </div>


                        </div>
                        <div class="posrel">
                        <div class="hero">
                        <h1 class="head1">something.com</h1>
                        <h3 class="head3">this is a random sentence.</h3>

                        </div>

                        </div>








                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          You can add position:relative div above absolute div and need to change some menu css






                          body{
                          margin: 0;
                          }

                          .here,.hereinner{
                          list-style-type: none;
                          margin:0px;
                          padding:0px;

                          }



                          .menu .here .choice{
                          float: right;
                          display: inline;
                          border: 3px;
                          background-color: orange;
                          opacity: .8;
                          line-height: 40px;
                          text-align: center;
                          font-size: 20px;

                          }

                          .hereinner li{
                          background-color: orange;
                          opacity: 1;
                          line-height: 40px;
                          text-align: center;
                          font-size: 20px;

                          }

                          .here .heh,.subs{
                          width: 200px;
                          height: 40px;
                          text-decoration: none;
                          color: white;
                          display: block;
                          }

                          .here .heh:hover{
                          background-color: green;
                          }

                          .hereinner{
                          display: none;
                          }

                          .subs{
                          text-decoration: none;
                          background-color: orange;
                          color: white;
                          }

                          .subs:hover{
                          background-color: green;
                          }

                          .choice:hover .hereinner{
                          display: block;
                          }
                          .clearfix{
                          clear:both;
                          }
                          .posrel{
                          position:relative;
                          }

                          .hero{
                          position: absolute;
                          width: 100%;
                          margin-left: 0;
                          margin-top: 0;
                          }

                          .hero .head1{
                          color: black;
                          text-transform: uppercase;
                          font-size: 70px;
                          text-align: center;
                          margin-top: 270px;
                          font-family: bodoni;
                          }

                          .hero .head3{
                          text-align: center;
                          font-family: helvetica;
                          }

                          <div class="menu">
                          <ul class="here">
                          <li class="choice" ><a href="" class="heh">About</a>
                          <ul class="hereinner">
                          <li ><a href="" class="subs">You</a></li>
                          <li ><a href="http://www.facebook.com" class="subs">Me</a> </li>
                          <li><a href="" class="subs">Us</a></li>

                          </ul>

                          </li>
                          <li class="choice"><a href="" class="heh">Contact Us</a></li>
                          <li class="choice"><a href="" class="heh">Sign Up</a></li>
                          <li class="choice"><a href="" class="heh">Log in</a></li>

                          </ul>
                          <div class="clearfix">

                          </div>


                          </div>
                          <div class="posrel">
                          <div class="hero">
                          <h1 class="head1">something.com</h1>
                          <h3 class="head3">this is a random sentence.</h3>

                          </div>

                          </div>








                          share|improve this answer












                          You can add position:relative div above absolute div and need to change some menu css






                          body{
                          margin: 0;
                          }

                          .here,.hereinner{
                          list-style-type: none;
                          margin:0px;
                          padding:0px;

                          }



                          .menu .here .choice{
                          float: right;
                          display: inline;
                          border: 3px;
                          background-color: orange;
                          opacity: .8;
                          line-height: 40px;
                          text-align: center;
                          font-size: 20px;

                          }

                          .hereinner li{
                          background-color: orange;
                          opacity: 1;
                          line-height: 40px;
                          text-align: center;
                          font-size: 20px;

                          }

                          .here .heh,.subs{
                          width: 200px;
                          height: 40px;
                          text-decoration: none;
                          color: white;
                          display: block;
                          }

                          .here .heh:hover{
                          background-color: green;
                          }

                          .hereinner{
                          display: none;
                          }

                          .subs{
                          text-decoration: none;
                          background-color: orange;
                          color: white;
                          }

                          .subs:hover{
                          background-color: green;
                          }

                          .choice:hover .hereinner{
                          display: block;
                          }
                          .clearfix{
                          clear:both;
                          }
                          .posrel{
                          position:relative;
                          }

                          .hero{
                          position: absolute;
                          width: 100%;
                          margin-left: 0;
                          margin-top: 0;
                          }

                          .hero .head1{
                          color: black;
                          text-transform: uppercase;
                          font-size: 70px;
                          text-align: center;
                          margin-top: 270px;
                          font-family: bodoni;
                          }

                          .hero .head3{
                          text-align: center;
                          font-family: helvetica;
                          }

                          <div class="menu">
                          <ul class="here">
                          <li class="choice" ><a href="" class="heh">About</a>
                          <ul class="hereinner">
                          <li ><a href="" class="subs">You</a></li>
                          <li ><a href="http://www.facebook.com" class="subs">Me</a> </li>
                          <li><a href="" class="subs">Us</a></li>

                          </ul>

                          </li>
                          <li class="choice"><a href="" class="heh">Contact Us</a></li>
                          <li class="choice"><a href="" class="heh">Sign Up</a></li>
                          <li class="choice"><a href="" class="heh">Log in</a></li>

                          </ul>
                          <div class="clearfix">

                          </div>


                          </div>
                          <div class="posrel">
                          <div class="hero">
                          <h1 class="head1">something.com</h1>
                          <h3 class="head3">this is a random sentence.</h3>

                          </div>

                          </div>








                          body{
                          margin: 0;
                          }

                          .here,.hereinner{
                          list-style-type: none;
                          margin:0px;
                          padding:0px;

                          }



                          .menu .here .choice{
                          float: right;
                          display: inline;
                          border: 3px;
                          background-color: orange;
                          opacity: .8;
                          line-height: 40px;
                          text-align: center;
                          font-size: 20px;

                          }

                          .hereinner li{
                          background-color: orange;
                          opacity: 1;
                          line-height: 40px;
                          text-align: center;
                          font-size: 20px;

                          }

                          .here .heh,.subs{
                          width: 200px;
                          height: 40px;
                          text-decoration: none;
                          color: white;
                          display: block;
                          }

                          .here .heh:hover{
                          background-color: green;
                          }

                          .hereinner{
                          display: none;
                          }

                          .subs{
                          text-decoration: none;
                          background-color: orange;
                          color: white;
                          }

                          .subs:hover{
                          background-color: green;
                          }

                          .choice:hover .hereinner{
                          display: block;
                          }
                          .clearfix{
                          clear:both;
                          }
                          .posrel{
                          position:relative;
                          }

                          .hero{
                          position: absolute;
                          width: 100%;
                          margin-left: 0;
                          margin-top: 0;
                          }

                          .hero .head1{
                          color: black;
                          text-transform: uppercase;
                          font-size: 70px;
                          text-align: center;
                          margin-top: 270px;
                          font-family: bodoni;
                          }

                          .hero .head3{
                          text-align: center;
                          font-family: helvetica;
                          }

                          <div class="menu">
                          <ul class="here">
                          <li class="choice" ><a href="" class="heh">About</a>
                          <ul class="hereinner">
                          <li ><a href="" class="subs">You</a></li>
                          <li ><a href="http://www.facebook.com" class="subs">Me</a> </li>
                          <li><a href="" class="subs">Us</a></li>

                          </ul>

                          </li>
                          <li class="choice"><a href="" class="heh">Contact Us</a></li>
                          <li class="choice"><a href="" class="heh">Sign Up</a></li>
                          <li class="choice"><a href="" class="heh">Log in</a></li>

                          </ul>
                          <div class="clearfix">

                          </div>


                          </div>
                          <div class="posrel">
                          <div class="hero">
                          <h1 class="head1">something.com</h1>
                          <h3 class="head3">this is a random sentence.</h3>

                          </div>

                          </div>





                          body{
                          margin: 0;
                          }

                          .here,.hereinner{
                          list-style-type: none;
                          margin:0px;
                          padding:0px;

                          }



                          .menu .here .choice{
                          float: right;
                          display: inline;
                          border: 3px;
                          background-color: orange;
                          opacity: .8;
                          line-height: 40px;
                          text-align: center;
                          font-size: 20px;

                          }

                          .hereinner li{
                          background-color: orange;
                          opacity: 1;
                          line-height: 40px;
                          text-align: center;
                          font-size: 20px;

                          }

                          .here .heh,.subs{
                          width: 200px;
                          height: 40px;
                          text-decoration: none;
                          color: white;
                          display: block;
                          }

                          .here .heh:hover{
                          background-color: green;
                          }

                          .hereinner{
                          display: none;
                          }

                          .subs{
                          text-decoration: none;
                          background-color: orange;
                          color: white;
                          }

                          .subs:hover{
                          background-color: green;
                          }

                          .choice:hover .hereinner{
                          display: block;
                          }
                          .clearfix{
                          clear:both;
                          }
                          .posrel{
                          position:relative;
                          }

                          .hero{
                          position: absolute;
                          width: 100%;
                          margin-left: 0;
                          margin-top: 0;
                          }

                          .hero .head1{
                          color: black;
                          text-transform: uppercase;
                          font-size: 70px;
                          text-align: center;
                          margin-top: 270px;
                          font-family: bodoni;
                          }

                          .hero .head3{
                          text-align: center;
                          font-family: helvetica;
                          }

                          <div class="menu">
                          <ul class="here">
                          <li class="choice" ><a href="" class="heh">About</a>
                          <ul class="hereinner">
                          <li ><a href="" class="subs">You</a></li>
                          <li ><a href="http://www.facebook.com" class="subs">Me</a> </li>
                          <li><a href="" class="subs">Us</a></li>

                          </ul>

                          </li>
                          <li class="choice"><a href="" class="heh">Contact Us</a></li>
                          <li class="choice"><a href="" class="heh">Sign Up</a></li>
                          <li class="choice"><a href="" class="heh">Log in</a></li>

                          </ul>
                          <div class="clearfix">

                          </div>


                          </div>
                          <div class="posrel">
                          <div class="hero">
                          <h1 class="head1">something.com</h1>
                          <h3 class="head3">this is a random sentence.</h3>

                          </div>

                          </div>






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 17 hours ago









                          Hiren Vaghasiya

                          2,1231417




                          2,1231417






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370933%2fdropdown-menu-not-working-after-placing-another-div%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                              ts Property 'filter' does not exist on type '{}'

                              mat-slide-toggle shouldn't change it's state when I click cancel in confirmation window