【问题标题】:Creating Hotspots for Resizable Image?为可调整大小的图像创建热点?
【发布时间】:2015-05-14 23:20:10
【问题描述】:

由于我无法创建带有所需文本的水平导航栏,我不得不在 illustrator 中创建一个新的navbar 并将其保存为 jpeg。我计划在homeproducts 上使用热点。当然,现在的问题是当用户调整浏览器的大小时,他们仍然需要点击链接。这样做的最佳方法是什么?当用户调整浏览器的大小时,我真的需要绘制出页面上可能出现单词的每个位置吗?

当用户调整大小时,homeproducts 将出现在页面上的三个不同位置。 HomeProducts 在第一张和第二张截图之间左右移动,在第二张和第三张截图之间上下移动。除此之外,页面上的文字几乎是固定的。

我担心用户可能会为不存在的单词找到热点。我怎样才能防止这种情况?谢谢你。

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
<!--
#banner {width:100%}
#banner img {width:100%;height:auto}
nav {width:100%;display:block;}
nav ul {list-style-type:none;margin:0;padding:0;text-align:center;
background-color:#c0872e;}
nav li {display:inline-block;background-color:#c0872e;
font-family:Georgia;}
nav a {line-height:35px; color:white; padding: 0 30px; font-size:22px;
 font-family:Georgia; background-color:#c0872e;}
nav a:hover {text-decoration:none}

a{float:left;margin-right:58px; margin-left:58px;color:#000;
text-decoration:none;
}
body {background-image: url("daikinbackground1.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
}

-->
</style>
<meta charset="utf-8"/>
<title>daikininc.com</title>
</head>
<body>
<div id="body">
<header>
<div>
<div style="text-align:center" id="banner">
<title="daikinincbanner">
<img src="daikinbanner1.jpg" border="0" alt="daikinbanner1">
</div>
<!--
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="products.html">Products</a></li>
</ul>
</nav>
-->
<nav style="text-align:center">
<img style ="height:300px" width="1355" src="navbarimage1.jpg">
</nav>
<br>
<p style="text-align:center;font-family:WindsorDemi;">
<font size="4">
Welcome to daikininc.com! Home to the world's greatest eggorll
wrappers and noodles.
</font>
</p>
<br><br><br><br><br><br><br><br><br>
</nav>
</header>
<section>
<aside>
</aside>
<article>
</article>
<footer>
</footer>
</div>
</body>
</html>

【问题讨论】:

  • “由于我无法创建带有所需文本的水平导航栏”是什么意思? This is a simplified example... 你想实现什么是 CSS 和没有图像无法完成的?
  • 我尝试使用 Windsor Bold 作为导航栏中的字体。即使我把它下载到我的电脑上,它也没有出现在浏览器中(它仍然显示为默认字体),而且我知道每个人的浏览器上都会显示有限数量的字体,除非他们下载了特定的字体。
  • 水平导航栏内的字体必须是Windsor Bold。

标签: jquery html css hyperlink imagemap


【解决方案1】:

您不应该对图像执行此操作。找到 Windsor 的 Web 字体版本并将其与 @font-face 一起使用。

css-tricks 有一个nice write up on using @font-face

【讨论】:

  • 哇,没门!谢谢!
【解决方案2】:

您可以创建一组与图像尺寸相同的重叠 div(内部带有链接)。如果您的图像没有根据视口调整大小,那么您应该在这些 div 上设置固定宽度/高度/位置。

话虽如此,我建议您在构建设计布局/样式时不要使用这样的大图像。它会为您省去一些麻烦。

【讨论】:

  • 对不起,我不知道我不能在回复中输入代码:)
  • 完整的 html 和 css 现在在原始帖子中。如果可能,请通过创建一组覆盖 div 来解释您的意思。谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2010-12-04
  • 2013-06-22
  • 2013-06-24
  • 2015-05-05
  • 2019-03-30
  • 2012-07-15
  • 2014-11-27
相关资源
最近更新 更多