I want on hover to display some items without moving the below content. My code is the following:
<ul id="try" >
<li>
<img class="flame" src="https://vignette4.wikia.nocookie.net/knightsanddragons/images/f/fa/Dragons-flame.png/revision/latest/scale-to-width-down/100?cb=20160727135656"/>
<ul>
<li class="one"><span>one </span></li>
<li class="two"><span>two </span></li>
</ul>
</li>
</ul>
<span>three</span>
and the css for hover:
ul#try li {display: inline-block;background: transparent;}
ul#try li:hover {background: transparent;}
ul#try li:hover ul {display: block;background: transparent;}
ul#try li ul {
display: none;
}
ul#try li ul li {
display: block;
background: transparent;
}
I want to display values one and two, without moving the <span>three</span>
Set ul#try li ul
to position: absolute
. Absolute positioning removes the element from the layout flow, and prevents it from changing other elements positions.
ul#try li {
display: inline-block;
position: relative;
background: transparent;
}
ul#try li:hover {
background: transparent;
}
ul#try li:hover ul {
display: block;
background: transparent;
}
ul#try li ul {
display: none;
position: absolute;
}
ul#try li ul li {
display: block;
background: transparent;
}
<ul id="try">
<li>
<img class="flame" src="https://vignette4.wikia.nocookie.net/knightsanddragons/images/f/fa/Dragons-flame.png/revision/latest/scale-to-width-down/100?cb=20160727135656" />
<ul>
<li class="one"><span>one </span></li>
<li class="two"><span>two </span></li>
</ul>
</li>
</ul>
<span>three</span>
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I am tryin to figure out, how to enlarge an Input-Field so that it fills the whole page below the title
I have made a page which has a transperant header and a logo in white colorBut when i scroll down my logo isn't visible because of white body color
how to stick the two depicted images with the above two imagesI am using relative position for my responsive webpage
I need to create a menu using a combination of ul > li > ul which scale horizontallyEach ul should have a max-height and to scroll if it overflows