2
Hello, my question is this. Let’s assume this code
<div>
<a>teste</a>
<a>teste</a>
<a>teste</a>
<a>teste</a>
</div>
This div is displayed when passing the mouse on a button, so far so good, but I checked on a site a similar case but it happened the following...the div had many options, when clicking on the dropdown menu, the div extends to the end of the screen, if the space is not enough to display all the content it generates a scroll, regardless of the position of the dropdown menu, the div only extends to the end of the screen, like: if the user rolled the page and the dropdown menu button was there at the bottom of the screen, by clicking on the menu...it makes the div go to that end of the screen.. showing few options and generating a scroll in the div, I’m trying to do the same, but if I put to div have height auto, when I click on the menu...it already shows all the content and extending the div out of the screen and does not generate scroll even with overflow:auto, because the div com height auto fits to the content and not the screen, I do not know if I could understand but summarizing, I want a div that extends only to the end of the screen, that it fits the screen and never display content that exceeds the visible part of the screen, then she has to create a scroll. I know you can do a schematic with javascript, but I want to know if there is a simpler alternative that use maybe only css.
Can you present your example more fully? Put together the rest of the html relevant to the interaction, the js and the css you’re using for these elements.
– Leandro Angelo
Leandro is a common dropdown menu, with css and html, but I didn’t want the content of the div to leave the screen, see here...https://www.clashofstats.com/rankings/global/players, wherever it has global, is a dropdown menu, you will notice that every time you expand it, regardless of the position it never exceeds the screen, I wanted something similar to this.
– Dunga Cardoso