我可以将div设为透明但可点击吗 [英] Can I make a div transparent, but clickable

查看:50
本文介绍了我可以将div设为透明但可点击吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在整个网页上都使用垂直滑块.要在每个页面之间移动,我想单击页面的顶部/底部以在幻灯片之间导航.为此,我在每个页面的顶部和底部放置了一个div,当您单击该div时,它将带您进入下一张/上一张幻灯片,但是这些div覆盖了某些页面上的某些内容.有没有一种方法可以使div的颜色透明",但仍然可以单击作为链接?抱歉,如果我没有正确解释自己,我是HTML CSS的新手.

I am using a vertical slider for my whole webpage. To move between each page I want to click the top/ bottom of the page to navigate between slides. To do this I have placed a div at the top and bottom of each page and when you click that div it brings you to the next/prev slide but these divs are covering some of my content on certain pages. Is there a way to make the divs 'transparent' in colour but still available to click as a link? Sorry if I haven't explained myself properly i am new to HTML an CSS.

推荐答案

我不确定我是否会遇到此问题-默认情况下,div为空(其中没有任何东西可以使之透明),只要您将可点击对象分配给div一些尺寸,它应该创建一个区域,您可以单击该区域在页面上的位置.

I'm not sure I get this problem - divs are empty by default (there's nothing in them to make transparent) so as long as you have assigned the clickable div some dimensions it should create a region you can click on where it is located on the page.

例如 http://jsfiddle.net/pWpAD/ [可点击框的前50像素).

e.g. http://jsfiddle.net/pWpAD/ [Top 50px pixels of the box are clickable].

div {
    width: 300px;
    height: 300px;
}
#backdiv {
    background-color: #f0f;
}

#topdiv {
    height: 50px;
    cursor: pointer;
}

如果我不明白您的问题,请告诉我.也许您可以提供一些代码?

If I've not understood your question let me know. Maybe can you provide some code?

这篇关于我可以将div设为透明但可点击吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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