zoukankan      html  css  js  c++  java
  • 两张图相对于第三张大图定位

      今天切图,想在两个图片上加个超链接,为了解决兼容性问题没有使用<area> 标签,想通过定位来实现,但是试了很多次,在不同的分辨率下都对不齐,移位了,后来想到msn网站上有两个图片也是通过定位来解决的,而且在任何分辨率下都不会偏移,因此依照msn官网的写法,果然实现了,代码如下:

      <body style="background:#7eb41e url(images/zhaoPin.jpg) no-repeat center top;margin:0px;padding:0px;">

      <a href="#"><div style=" background:url(images/zp1.jpg) no-repeat 0px 0px;369px;height:201px;position: fixed;_position: absolute;top: 365px; _top:expression(eval(document.documentElement.scrollTop+40));left: 50%; margin-left:-419px;"></div></a>
      <a href="#"><div style=" background:url(images/zp2.jpg) no-repeat right top;369px; height:201px;position: fixed;_position: absolute;top: 363px; _top:expression(eval(document.documentElement.scrollTop+40));margin-left:65px;left: 50%;"></a></div></a>
      </body>

    但是这有个问题,我百思不得其解,我用left:28%;如果改变分辨率的话图片就会移位,但是如果用left: 50%;和margin-left:65px;的时候更改分辨率图片就不会移位。

  • 相关阅读:
    CodeForces 656B
    时间限制
    哈哈
    &1的用法
    codeforces 385 c
    hdu 1176 免费馅饼
    poj 1114 完全背包 dp
    poj 1115 Lifting the Stone 计算多边形的中心
    jar包解压
    重定向
  • 原文地址:https://www.cnblogs.com/fuyali/p/4347564.html
Copyright © 2011-2022 走看看