gpt4 book ai didi

jquery - 如何使用 jquery.css() 设置链接颜色

转载 作者:行者123 更新时间:2023-12-01 06:16:03 25 4
gpt4 key购买 nike

有没有办法使用the jquery css properties设置a href链接颜色?

基本上我需要设计简单模型的样式 http://www.ericmmartin.com/projects/simplemodal_v12/containerCss 选项,我需要传递该样式:

New in 1.2, you have the option to use external CSS or to pass in CSS attributes for the modal overlay, container, and data elements as options. The options are: overlayCss, containerCss and dataCss and take a key/value object of properties. See the jQuery CSS Docs for details.

最佳答案

您可以只使用它的 CSS 定义:

$('a').css({
color: '#ff0000'
});

或者,使用更短的语法:

$('a').css('color', '#ff0000');

编辑:因为您使用的是 Simplemodal:您只能使用 this page 中描述的语法来设置模态中的覆盖、容器和数据包装元素的样式。 。如果您想设置其他任何样式,只需使用 CSS 或根据您想要设置样式的 DOM 节点创建一个 jQuery 选择器即可。

关于jquery - 如何使用 jquery.css() 设置链接颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6871508/

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