S
S
smoklew2015-11-07 16:09:02
css
smoklew, 2015-11-07 16:09:02

Pull-out menu?

How do I make a slide-out menu item match the width of the item from which it slides out?
I'm doing it on opencart, here's the css:

#menu > ul > li > a {
  padding:0px 20px;
  color: #000;
  line-height: 37px;
  text-decoration: none;
  display: block;
  z-index: 6;
  position: relative;
  font-family:calibri;
  font-size:14px;
}
#menu > ul > li:hover > a, #menu > ul > li > a.active {
border-bottom:3px solid #00a100;
}
#menu > ul > li > div {
  display: none;
  background: #FFFFFF;
  position: absolute;
  z-index: 999;
  padding: 5px;
  border: 1px solid #000000;
  -webkit-border-radius: 0px 0px 5px 5px;
  -moz-border-radius: 0px 0px 5px 5px;
  -khtml-border-radius: 0px 0px 5px 5px;
  border-radius: 0px 0px 5px 5px;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Turovnikov, 2015-11-07
@turovnikoff

You presented only a part of css, without html, and the very principle of dropping out is unknown - js / css. I guess it's enough to add:

#menu > ul > li{
  position:relative;
}
#menu > ul > li > div {
  width:100%;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question