Arbaaz Arbaaz - 1 year ago 93
ASP.NET (C#) Question

How to set size of font with CSS without using - hyphen?

I have been trying to set font size using following code:

border:'0px', solid: '#f00', margin:'5px 0px',font-size: '14px'

But it doesnt work. Visual studio shows a red line and says it expects : where there is -

In fact I found out it doesnt even work on jsfiddle

Answer Source

It will work if you wrap font-size into quotes. By putting the value in quotes, it becomes a string.

.css({border:'0px', solid: '#f00', margin:'5px 0px','font-size': '14px'})

updated fiddle

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download