css - 使用CSS在悬停时 move 图像

标签 css image hover move

有没有可能有这种悬停效果http://apotheke-hh.de/index.php?option=com_content&view=category&layout=blog&id=11&Itemid=2 使用 css,在所有主要浏览器中工作?

对于阅读本文的其他人,如果链接已损坏 - 请参阅所附图片。

问候 托斯滕! hover image two

hover image one

最佳答案

我想你可以适用于所有主流浏览器,但这当然取决于版本,这里是一个例子:

HTML

<div class="all">
    <div class="col one"></div>
    <div class="col two"></div>
    <div class="col three"></div>
</div>

CSS

.col {
   float:left;
    width: 33.3333%;
    height: 150px;
    transition:width 300ms ;
}

.all:hover .col{
    width:25%;
}
.all:hover .col:hover {
    width: 50%;
}

JSFiddle 直播:http://jsfiddle.net/pavloschris/mrXPu/

唯一的“奇怪”规则是 transition,它有很好的支持,如 Can I Use 中所示。

关于css - 使用CSS在悬停时 move 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21233318/

相关文章:

css - IE7 - css 背景图像消失

android - 如何在android中使用html代码打开本地存储的图像?

hover - Plotly,更改悬停文本

css - 悬停时更改按钮内的字体图标颜色

javascript - 隐藏滚动条并使用 CSS 向左向右滑动

jQuery/CSS : Fluid responsive isotope grid with square divs

加载大量文件时发生 Java ImageIO.read() OutOfMemoryError

c++ - 锐化图像 - 访问邻近像素

javascript - 播放后如何重设声音?

html - 如何反向悬停热点图像?