Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to use quotes?

Tags:

css

Where and how should quotes be used in CSS?

width: 150px;         /* or */ width: "150px";
height: 50%;          /* or */ height: "50%";
font-family: Verdana; /* or */ font-family: "Verdana";
like image 521
bestl Avatar asked Jan 29 '26 16:01

bestl


1 Answers

You only need to use quotes if the property value has spaces in it. In practice, I think the only cases in which this is likely to come up are font names and URLs.

Example:

font-family: "DejaVu Sans", sans-serif;
like image 167
Syntactic Avatar answered Jan 31 '26 08:01

Syntactic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!