如何让div标签链接回首页?

发布于 2024-08-12 16:12:26 字数 227 浏览 1 评论 0原文

http://www.winteradagency.com/Arvin/advantages/advantages.htm

我需要左上角的徽标来链接回该网站的主页。我不知道如何使标签中包含锚标签。

谢谢!

http://www.winteradagency.com/Arvin/advantages/advantages.htm

I need the logo in the top left corner to link back to the home page for this site. I can't figure out how to make a tag have an anchor tag in it.

thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

漆黑的白昼 2024-08-19 16:12:26

在标题 div 中添加这样的元素,以将透明链接放在徽标顶部:

<a href="/" id="logo"> </a>

将其添加到样式表中:

#logo { position: absolute; left: 31px; top: 26px; width: 190px; height: 190px; }

Add an element like this in the header div to put a transparent link on top of the logo:

<a href="/" id="logo"> </a>

Add this to the style sheet:

#logo { position: absolute; left: 31px; top: 26px; width: 190px; height: 190px; }
書生途 2024-08-19 16:12:26

我在左上角没有看到徽标;页面顶部有红色块,然后“激励”从中间开始,其他选项从右侧开始。目前尚不清楚您想要返回主页的内容。

I don't see a logo in the top left corner; there's the red block all across the top of the page, and then "Incentives" starts in the middle and the other choices go from the right there. It's unclear what you want to go back to the home page.

£噩梦荏苒 2024-08-19 16:12:26

鉴于其答案的简单性,我不确定这是否是一个真正的问题。我只能假设我一定错过了一些明显的事情。但要解决:

<块引用>

我需要左上角的徽标来链接回该网站的主页。

有这样的:

<div id="whatever_id">
<a href="path/to/page.html" title="path to page"><img src="path/to/image.png" alt="this is a link to whatever page." /></a>
</div>

致地址:

<块引用>

我不知道如何使标签中包含锚标签。

据我所知,您不能嵌套 标签。我可能是错的,但我确信我在Eric Meyer 的网站上读过(不,我可以'找不到这篇文章,抱歉)这是不可能的。也许可以用 JS 来实现?

I'm unsure if this is a real question, given the simplicity of its answer. I can only assume I must've missed something obvious. But to address:

I need the logo in the top left corner to link back to the home page for this site.

There's this:

<div id="whatever_id">
<a href="path/to/page.html" title="path to page"><img src="path/to/image.png" alt="this is a link to whatever page." /></a>
</div>

To address:

I can't figure out how to make a tag have an anchor tag in it.

You can't, so far as I know, nest <a> tags. I could be wrong, but I'm sure that I read, on Eric Meyer's site (and no, I can't find the article, sorry) that it wasn't possible. It could be effected with JS, perhaps?

蓝咒 2024-08-19 16:12:26

由于您的整个标题是一张图像(包括徽标),因此您需要使用图像映射来完成此操作。我知道 Dreamweaver 有一种简单的方法来创建它们。 Bing 为第一个链接返回 this

Since your entire header is one image (including the logo) you would need to use an image map to do it. I know Dreamweaver has an easy way to create those. Bing returns this for the first link.

星星的軌跡 2024-08-19 16:12:26

您需要添加一个覆盖徽标所在区域的地图标签

示例:请注意,坐标必须是您希望能够单击的区域的实际坐标。

<map name="logomap">
  <area shape="poly" coords="x1,y1,x2,y2,..." href="/" alt="Home" />
</map>

You need to add a map tag that covers the area where the logo is.

Example: note that the co-ordinates need to be the actual coordinates for the area you want to be able to click.

<map name="logomap">
  <area shape="poly" coords="x1,y1,x2,y2,..." href="/" alt="Home" />
</map>
┊风居住的梦幻卍 2024-08-19 16:12:26

<div> is just a block tag.

The tags in HTML are divided in block tags and inline tags

<a style="display:block"> will act just like div. You replace tag by tag performing small changes in your css: adding {display:block} and maybe {text-decoration:none; color:black; cursor:normal}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文