If I have two nested div elements in my index.html page:
<body> <div id="parent"> <div id="child"></div> </div> </body>
parent div has a width of 900, a height of 800
I would like the child div be in the upper right corner of the parent div , so I define CSS for the child div as follows:
#child { position: absolute; top: 0; right: 0; width: 300px; height: 30px; }
The CSS is in order that it makes the child div located in the upper right corner of the parent div .
But , if I changed (reduced) the size of the browser window, at some point the child div will disappear (hide).
How to make a child div always visible, but still located in the upper right corner of the parent div no matter how the browser window is resized?
source share