Arbaaz Arbaaz - 5 months ago 40
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


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