Interview Questions

How do I quote font names in quoted values of the style attribute?

CSS Interview Questions and Questions


(Continued from previous question...)

58.How do I quote font names in quoted values of the style attribute?

The attribute values can contain both single quotes and double quotes as long as they come in matching pairs. If two pair of quotes are required include single quotes in double ones or vice versa:

<P STYLE="font-family: 'New Times Roman'; font-size: 90%">
<P STYLE='font-family: "New Times Roman"; font-size: 90%'>

It's been reported the latter method doesn't work very well in some browsers, therefore the first one should be used.

(Continued on next question...)

Other Interview Questions