繁体   English   中英

如何在ColorBox弹出窗口中显示标题和标题(来自图片“ alt”属性的标题和来自“ title”属性的标题

[英]How do I display, in a ColorBox popup, a caption AND a title (caption from image 'alt' attribute and title from 'title' attribute

我试图在ColorBox弹出窗口中显示标题和标题(图像'alt'属性的标题和图像'title'属性的标题)。 单击图像时将打开颜色框。

这是我想做的一个例子。

截图

img将类似于以下内容。

<img typeof="foaf:Image" src="http://localhost:4444/img.jpg" width="336"   height="254" alt="LEGEND / CAPTION balbalblalblalba balbalblalblalba balbalblalblalba" title="TITLE balbalblalblalba balbalblalblalba balbalblalblalba" class="">

您是否知道我该怎么做?

您可以使用div设置背景图像

div
{
    height: 616px;
    background:url(http://i.stack.imgur.com/eXA9b.jpg)
}

然后使用:before和:after选择器,将文本添加到所需位置

div::before { 
    content: "Title"
    position: relative;
    top: 100px;
    background-color: white;
    opacity: 0.5;
}

div::after { 
    content: "Caption";
    position: relative;
    top: 400px;
    background-color: white;
    opacity: 0.5;
}

更改顶部以将文本移至所需位置,并更改不透明度以获取所需的不透明度

完整的小提琴在这里http://jsfiddle.net/rsm07fdw/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM