When using CSS properties with hyphens, you must convert them to
camelCase, e.g, "textAlign". It might also work if you use the two-
argument version of the css function, e.g. .css("text-align",
"center")
o
On Aug 5, 5:45 am, jayturley <[EMAIL PROTECTED]> wrote:
> I am having a bit of a problem with this function.
>
> The code I have is:
>
> $('.aDiv').css({ float: 'left', border: '1px dashed #ccc', margin:
> '1px', padding: '10px' });
>
> If I try to add any css property with a hyphen in it, such as text-
> align or font-family,
>
> $('.aDiv').width(40).height(40).css({ text-align: 'center', float:
> 'left', border: '1px dashed #ccc', margin: '1px', padding: '10px' });
>
> it generates a error:
>
> missing : before property id
>
> Any ideas on how I can work around this?
>
> Thanks!
>
> -Jay