首页 > 解决方案 > 将链接粘贴到背景图像上的特定区域

问题描述

我正在建立一个网站,我希望背景图像的某些区域具有一些动态文本。所以我创建了一个具有以下样式的 DIV:

html {
  background: url(pics/main-bg2_1280.jpg) no-repeat center center fixed;
   -webkit-background-size: cover;
   -moz-background-size: cover;
   -o-background-size: cover;
    background-size: cover;     }
.thediv { height: 16%;
  width: 16%;
  position: fixed;
  top: 14%;
  left: 6%; }

但是当窗口调整大小时 div 会稍微移动
有什么方法可以确保 div 始终在同一个位置,而不管窗口大小和比例(宽度 x 高度)如何
谢谢

标签: htmlcss

解决方案


推荐阅读