使用Div而不是锚点 [英] Using Div's instead of anchors

查看:170
本文介绍了使用Div而不是锚点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站www.funpunks.com上,在页面的左上角会显示导航。我使用固定大小的div与背景图片,并使用javascript重定向window.location =' http:// www.funpunks.com/ 等。

On my website, www.funpunks.com, in the top left of the page you'll see the navigation. I made this using fixed-size div's with background images, and using javascript to redirect "window.location = 'http://www.funpunks.com/' " etc.

但是对于有javascript禁用等的用户呢?我想我需要使用锚标签。

But what about for users who have thier javascript disabled etc? I think I need to use anchor tags.

我需要这些锚标签显示为块,我需要他们有一个背景图像。每个不同的链接都需要有自己的高度/宽度和悬停图片。

I need these anchor tags to display as block, and I need them to have a background image. Also each different link needs to have its own height/width and hover image.

是否可以使用锚标签而不是div?

Could it be done with using anchor tags instead of divs?

感谢

推荐答案

为什么你还没有使用锚点而是将它们显示为块级元素使用CSS?

Why don't you still use anchors but display them as block-level elements with CSS?

a.some-class { display:block; }

这篇关于使用Div而不是锚点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆