0

I have 2 <label> in the right corner of div which located in the center of browser with width/height is 200px/200px. When i change browser size my labels disappears in the right side of browser. How can i make that labels moves to the right side when browser size is changes? I try to make:

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

But right property is right from the browser window, not from the div.

I need that labels move only when it disappears with browser.

Thank you.

4

1 回答 1

3

正如乔治所说,让父position:relative元素的位置相对于包含元素(而不是窗口)是绝对的。

如果您真的想根据浏览器大小/分辨率调整 CSS,请阅读 CSS 媒体查询:

https://developer.mozilla.org/en-US/docs/CSS/Media_queries

于 2013-05-08T18:47:09.757 回答