dqpciw9742 2014-10-27 00:37
浏览 39
已采纳

在wordpress中创建响应式图像链接映射

I have an image link map in the header of my wordpress theme that I need to make responsive under 750px. I have been able to make the links show up in the header but they aren't active and I'm not sure why. Right now I'm just trying to get the "p1" link to work.

site is here: indie-scene.com

Here is my php:

<div class="header header-default">
        <img src="<?php echo $ti_option['site_logo']['url']; ?>" alt="<?php bloginfo( 'name' ); ?> - <?php bloginfo( 'description' ); ?>" width="<?php echo $ti_option['site_logo']['width']; ?>" height="<?php echo $ti_option['site_logo']['height']; ?>" />
       <div class="hotspots">
            <a href="http://www.nearlynewlywed.com" class="p1"></a>
        <div title="home">
            <a href="http://www.indie-scene.com" class="p2"></a>
        </div>
        <div title="sell">
            <a href="http://www.nearlynewlywed.com/a/sell" class="p3"></a>
        </div>
      </div>
    </a><!-- Logo -->

and my media query in css

@media only screen and (max-width: 750px)  {
 .header {
   width:100%;
}
 .header img {
  content: url(http://indie-scene.com/wp-content/uploads/2014/10/logo_no_banner.png);
max-width: 276px;
}
.header {width:100%; position:relative; }
.header .hotspots {width:100%; height:100%; position:absolute; left:0; top:0; visibility:hidden;}
.header a {display:block; position:absolute; background:#000; z-index:100; opacity:0.2; filter: alpha(opacity=20); border:1px solid transparent; }
.header a.p1 {left:50%; top:5%; width:50%; height:50%;}
  • 写回答

1条回答 默认 最新

  • dpgvdfg321041670 2014-10-27 01:27
    关注

    The links aren't appearing because you've set the visibility of your hotspots div to be hidden for widths under 750pxhere:

    .header .hotspots {width:100%; height:100%; position:absolute; left:0; top:0; }
    

    You will either need to remove visibility:hidden; from the CSS above or change it to visibility: visible;.

    enter image description here

    In the above image, I set the visibility of the hotspots div to visible using the developer tools and you can see that your .p1 link is appearing now.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 phython读取excel表格报错 ^7个 SyntaxError: invalid syntax 语句报错
  • ¥20 @microsoft/fetch-event-source 流式响应问题
  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式
  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?