I have a ul/li which is only visible with onkeyup event.
If an input field is empty the ul/li disappears (hide), all is done with plain JavaScript and Jquery.
The problem is that I want to position a div underneath the ul/li (when it is visible).
How do I do that? Should I use CSS like position:absolute/relative/fixed (which didn’t work so far), or do I have to use JavaScript for this?
I have a ul/li which is only visible with onkeyup event. If an input
Share
You have two options with pure CSS:
1) Use
absoluteposition.2) Give parent element
relativeposition and your div (child)absoluteposition so that child does not escape out of parent. Finally usetop,left,bottom,rightproperties to position element exactly where you want.