javascript - Logo 未出现在背景图片上的问题

标签 javascript jquery html css image

我使用 photoshop 在背景图片上叠加了一个标志。我设置了响应式背景图像。我设置了一个图像映射以使用 Logo 作为主页链接。我在网站的其他两个页面上运行良好,但由于背景图像的设置方式不同,此页面有所不同。我想我可以通过使用透明图像和 usemap 来玩个把戏。不工作。当我将鼠标悬停在图像 map 上时,我可以看到手,但那里没有 Logo 。网址是 http://jandswebsitedesigns.com/test/index.html .左上角的 Logo 示例是 http://jandswebsitedesigns.com/test/im-new-here.html .我在 im-new-here 页面上遇到了类似的问题。图像上部顶部的“顶栏”div(透明)覆盖了可点击区域。塞缪尔回应了,我添加了 div#top-bar { height: 0px; } 并修复了它。工作得很好,但同样的修复在这里不起作用。

<style>
body  {

background: url(images/cd-background-1.png) no-repeat center center   fixed; 
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;  
position: relative; 
min-height: 100%;  
z-index: 1;   }  
</style>

<div style="text-align:  center; height:  800px;">
    <img src="images/trans.png" usemap="#logomap">
        <map name="logomap">
            <area shape="poly" coords="11,2,430,3,432,307,3,320"   

             style="outline:none;" href="index.html" alt="main page">
        </map>


 </div>

最佳答案

如果没有为包含它的元素设置高度和宽度,则图像背景可能不会出现

html, body{
    width:100%;
    height: 100%:
}
.my-div{
    display: block:
    width: // must give width
    height: // must give height
    background-image: url('...'):
}

关于javascript - Logo 未出现在背景图片上的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29735781/

相关文章:

javascript - 隐藏通过覆盖元素显示的文本输入光标(插入符号)Internet Explorer

javascript - 如何通过 id 将数组元素与指令中的 dom 类元素绑定(bind)?

javascript - Handlebars 的奇数和偶数比较助手

javascript - 我应该为每个请求从 sessionStorage 获取访问 token 吗?

javascript - 使用 jQuery 1.4.4 这个简单的方法由于某种原因失败了

支持从右到左的 jQuery 选取框(来自无序列表)

javascript - "SyntaxError: missing ) after condition"

java - 包含 2 个操作的表单(不正常)

javascript - 我可以捕获 js 触发的更改事件吗?

javascript - 如何在打字时以正确的大小渲染文本区域并自动扩展?