简体   繁体   English

在Llightbox弹出窗口中链接

[英]Link within a llightbox pop-up

I'm currently working on this page and I'm trying to add a link within the lighbox pop-up but when ever I do that It messes up the image display as shown on the page. 我目前正在此页面上工作,我试图在lighbox弹出窗口中添加一个链接,但是无论何时我这样做都会弄乱页面上显示的图像显示。 I want it to show under these words (XHTML | Javascript | Jquery | Design | Logo) when the image pops up. 我希望它在图像弹出时显示在这些单词(XHTML | Javascript | Jquery | Design | Logo)下。 Any ideas. 有任何想法吗。 The HTML is as shown below: HTML如下所示:

    <li><a href="images/huelarge.png" title="XHTML | Javascript | Jquery | Design | Logo<br />
<a href="services.php">Go to site</a>">
        <img src="images/huethumb.jpg" alt="" width="314" height="157" /></a></li>
        <li>

The issue is that your Java (or whatever makes your "A" link) has errors in it's structure. 问题是您的Java(或任何使您的“ A”链接产生的错误)的结构有误。 Therefore, you end up with a tag that looks like 因此,您最终得到的标签看起来像

<a servers.php"="> <!--Your Link Text--> </a>gt;"

Because of the poor structure, the gt;" is added to the DOM without being wrapped around any element. Take a look at your structure of that markup wherever you generate it and fix it. 由于结构不良,因此gt;“被添加到DOM中,而没有被包裹在任何元素周围。无论您在哪里生成并修复它,都请看一下该标记的结构。

Then, in your CSS: 然后,在您的CSS中:

#sampler ul li{
  //everything else that was default stayed the same, add the next line.
  position:relative;
}

Now, make the anchor absolutely positioned. 现在,使锚点绝对定位。 It's parent (#sampler ul li) is relative, so it will stick to the scope of that element. 它的父级(#sampler ul li)是相对的,因此它将坚持该元素的范围。

#sampler ul li a{
  position:absolute;
  //set your top and left values
  top: value;
  left: value

}

Now, if you've fixed your tags so they now look proper, like such: 现在,如果您已修复标签,则它们现在看起来正确,例如:

<a href="services.php"> <!--Your Link Text--> </a>

Then the element will position absolutely over the LI and work as intended, at that point you can style the anchor element as intended and change the top and left's until you've got it positioned where you like. 然后,该元素将完全定位在LI上并按预期工作,此时,可以按预期的方式设置锚元素的样式,并更改顶部和左侧的锚点,直到将其放置在所需的位置为止。

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

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