gpt4 book ai didi

html - 如何在同一页面上获得不同样式的链接并仍然使用 colorbox?

转载 作者:行者123 更新时间:2023-11-28 03:27:19 24 4
gpt4 key购买 nike

我正在构建一个包含多个样式链接的网页,如下所示:

<a class="green" href="green.htm">Link is green and becomes blue on mouse over</a>

<a class="red" href="red.htm">Link is red and becomes yellow on mouse over</a>

然后我有这样的 css 类:

a.green {   color: green; }
a.green:hover { color: blue; }


a.red { color: red; }
a.red:hover { color: yellow; }

但是我想在 Colorbox 中打开 green.htmred.htm...显然我不能再使用类了,因为我需要它们链接着色。

如何在同一页面上获得不同样式的链接并仍然使用 colorbox?

更新:我已经使用 onclick 事件来启动颜色框效果。

<a class="green" onclick="$.colorbox({innerWidth:500, innerHeight:300, href:'green.htm'});">Link is green and becomes blue on mouse over</a>

它不是很漂亮,但它会一直用到我想有一天我会用一种更干净的方式做事。

最佳答案

尝试:

<element class="red">
all content of red.htm
</element>
<element class="green">
all content of green.htm
</element>

关于html - 如何在同一页面上获得不同样式的链接并仍然使用 colorbox?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20391942/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com