Arbaaz Arbaaz - 15 days ago 5
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:

.css({
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
http://jsfiddle.net/17ed42pa/132/

Answer

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