悬停中心文本上的图标题
figure caption on hover center text
在这个小提琴 http://jsfiddle.net/sLdhsbou/中,无论图像的大小如何,我都希望悬停时出现的"x"绝对居中。
另外,为什么当鼠标移动到图形之外时没有过渡,就像鼠标移入时一样?
<table border=1 style="width: 100%;">
<TR><TD COLSPAN=6 STYLE="border-bottom: medium solid gray;"> </TD></TR>
<tr>
<td class="left" style="width: 25%; background-color: cyan;">
<table border=2 style="width: 100%;">
<tr>
<td style="border: thin solid #ff9900;">
<div class="img-wrap">
<figure class="cap-bottom">
<img src="http://placehold.it/300x200" />
<figcaption>
<div class="icon icon-image"></div>
</figcaption>
</figure>
</div>
</td>
</tr>
</table>
</td>
<td colspan=2 style="padding-top: 12px; padding-right: 12px;">
<center><span style="font-size: 16px; font-weight: bold;">lorem ipsum</span></center>
<br/>lorem ipsum dolor sit amet, prima brute at cum, ius tota fugit error te, eum an quod invidunt. an facer fierent iudicabit vix, pri at illud diceret probatus. maiorum ponderum omittantur te per, pri alterum propriae postulant at. ut pro nostro petentium salutandi.
<p/>est dico stet quaeque no, ei eos dolores dignissim. mei dicunt indoctum deterruisset an, recteque moderatius eu nam. per praesent efficiantur ut, ad mel assum laoreet tincidunt. ad qui agam nullam causae, ut mei minim clita, ut movet verterem democritum est.
</td>
</tr>
<TR><TD COLSPAN=6 STYLE="border-top: thin solid gray;"> </TD></TR>
</table>
figure img{display:block}
figure
{
display: block;
position: relative;
float: left;
overflow: hidden;
margin:0; padding:0
}
figcaption
{
display: block;
position: absolute;
background: rgba(255,204,51,0.75);
color: white;
opacity: 0;
-webkit-transition: all .6s ease;
-moz-transition: all .6s ease;
-o-transition: all .6s ease;
transition: all .6s ease
}
figure:hover figcaption
{
opacity: 1;
width: 100%;
height: 100%;
}
.cap-left figcaption{bottom:0;left:-100%}
.cap-left:hover figcaption{left:0}
.cap-right figcaption{bottom:0;right:-100%}
.cap-right:hover figcaption{right:0}
.cap-top figcaption{left:0;top:-100%}
.cap-top:hover figcaption{top:0}
.cap-bottom figcaption{left:0;bottom:-100%}
.cap-bottom:hover figcaption{bottom:0}
.icon { line-height: 1; }
.icon:link, .icon:visited, .icon:focus { color: #000; }
.icon-image
{
position: absolute;
top: 42%;
left: 47%;
font-size: 24px;
}
.icon-image:before{content: "x"}
.cap-bottom:hover figcaption {
top: 0;
}
.cap-bottom figcaption {
left: 0;
top: 100%;
width: 100%;
height: 100%;
}
更改您的 CSS 如上:)
希望这对你有帮助
相关文章:
- Javascript更改图标
- CSS-如何定位内容数据标题
- 在PHP中使用javascript更改页面标题'if'
- 单击更改图标并通过javascript添加一个css类
- Brightcove获取/显示HTML中的当前视频标题和描述
- React组件-设置页面标题
- jQuery动态更改标题
- 我希望只有在我滚动页面后才能显示我的返回页首图标
- HighCharts长标题文本在某些元素上重叠
- react-将图标添加到组件内部的标题中
- 如何在引导程序下拉标题中显示带有图标的选定项目
- 页面更改时动态更改标题按钮图标,jQuery mobile 1.4.5
- 如何在最右侧的标题中放置图标
- 重新定位 Jquery UI 手风琴的标题图标
- 当按钮附加到标题时图标不改变
- Jquery移动浮动:左问题,标题图标块页面的左侧
- 为jquery FullCalendar的标题添加图标
- 在滚动时将标题/导航转换为导航图标
- 如何获得favicon图标/苹果触摸图标和标题的网页使用Javascript或Jquery
- 在JQGrid的标题栏中添加多个图标