gpt4 book ai didi

jQuery 多个 css 值 - "float"问题

转载 作者:行者123 更新时间:2023-11-28 09:20:13 24 4
gpt4 key购买 nike

因此,我正在使用 jQuery 定义一些 CSS 值。我像这样定义多个值:

$('#elementId').css({
height : '60px',
width : '268px',
display : 'block',
float : 'left'
});

请注意,我也在调整“ float ”。虽然它确实有效,但“float”(显然)是一种数据类型,我的编辑器将其识别为此类。我想知道是否有更合适的方法来更改 float CSS 值,而不是使用保留的 float 数据类型。我想这是一种强制症问题,但我喜欢做正确的事情。

谢谢。

最佳答案

尝试用引号括起来:

$('#elementId').css({
'height': '70px',
'width': '280px',
'display': 'inline-block',
'float': 'left',
});

查看此 example

关于jQuery 多个 css 值 - "float"问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11838676/

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