English 中文(简体)
新型滚动,如果使用CSS,基调小于图像?
原标题:New kind of rollover where the anchor is smaller than the image, using CSS?

I have been working on a link rollover effect for my website, to achieve the following:

┌────────────────────────────┐
│  ┌──────────────────┐      │
│  │ <a>              │      │
│  └──────────────────┘      │
│                            │
│                 <img>      │
└────────────────────────────┘

I want the background image, <img>, to appear when the mouse hovers only over the link, <a>. In other words, when the link part is hovered over, I want the image behind it to appear (or change state) without becoming "clickable" as well. And I would like to do it with only CSS.

如果<代码><a> 是<a> 是<代码>的任何地方, tag,一旦发现,整个图像即成为“可动摇的”,而B)我想使用更大规模、更优质的图像,并将图像列入超文本,避免使用Javascript或浏览器 ha在装载前。

My solution was to put the <a> and the <img> within a parent <li> (since this is essentially part of the "menu" or site navigation), and then use the adjacent sibling selector (+) to make the <img> change when the <a> is hovered over. At it s most basic, the CSS looks like this:

li {
   size and position declarations; /*The size is the same as the contained image.*/
}

li a {
   absolute size and position declarations for the link area;
   z-index: 2; /*I use the z index to make sure the link stays above the image.*/
}

li img {
   absolute size and position declarations for the image;
   z-index: 1;
   display: none;

li a:hover + img {
   display: block;
}

而基本的超文本则认为:

<ul>
   <li><a href="page.htm"> </a><img src="image.jpg"></li>
   <li>...
</ul>

如果你们想看到它采取行动,我就要在www.joshuakirby.net/test上进行测试。 (作为gent子——我是自学的,我很容易承认我没有专家在ding。) 除IE外,它在我所尝试的所有主要浏览器中都发挥了巨大作用。 我不得不在任何伊埃文版本中,甚至在伊埃9版本中适当开展工作。 滚动浮标像IE6中所做的那样,连接点总是可以点击第一次甚至第二次。

是否有任何人知道,为什么教育学会会给我带来悲痛? 是否有一些固定办法使这一中心像其他浏览器一样? 或者,如果整个方法一到一来,谁会想到一种更加友好的交叉增长者,那么利用经济、社会、文化权利委员会来进行这一滚动工作?

我不是网络设计的新手,如果我需要,我也可以处理联合预算和项目。 刚刚向我发出呼吁,要求我们与特别安全局合作。 事先感谢你们的帮助!

最佳回答

造成浮油的原因是,当电离层电离层无损时,电离层电离层似乎尊重该连接的z-指数值。 然而,如果你把链接(例如#craftsLink a)的背景情况确定为透明的平方形象,那么,这个网站似乎可以确定问题与安放点;该网址在IE7+中运行。

问题回答

Would something like this work?

http://jsfiddle.net/lazerblade01/CAhuy/

你可以把你的形象作为亲人的背景形象,而不是明显的肤色。

EDIT:在IE9中进行刚刚测试(IE的唯一版本可以进入另一个电脑,而没有boot子)。 背景文件似乎在工作时没有减弱。 让我知道,这是否有利于形象。





相关问题
Image rendered with wrong colors in IE8

I have a gradient image as a PNG (no transparency) in a web-page. By taking a screenshot of Chrome showing the page and cropping the image from the page, I see the exact same colors are drawn as the ...

Determine Mobile Internet Explorer version

I need to determine the version of Mobile Internet Explorer on a Windows Mobile 6.1 device. So that I can report the same user-agent string as is being used by Mobile Internet Explorer. The user-...

CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

Internet Explorer only part loading JavaScript/CSS

I m having trouble with my local development environment where IE (6 through to 8) is only part loading JavaScript/CSS files. It throws random errors at random places in jquery.min.js every time I ...

IE doesn t run Javascript when you click back button

I ve built a shop with tons of JS running. One of the pieces of the cart, is a zip code field which is required to calculate shipping cost. This works fine going through the cart. Now clicking ...

热门标签