css - Change elements position when browser changes size -


i have 2 <label> in right corner of div located in center of browser width/height 200px/200px. when change browser size labels disappears in right side of browser. how can make labels moves right side when browser size changes? try make:

.my_label{   position:absolute;   right: 20px; } 

but right property right browser window, not div.

i need labels move when disappears browser.

thank you.

as george stated, make parent position:relative have child element's position absolute in relation containing element (instead of window).

if want tweak css based on browser size / res, read on css media queries:

https://developer.mozilla.org/en-us/docs/css/media_queries


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -