2010-05-24 80 views
2

在哪里以及如何在CSS中使用引号?在哪里使用报价?

width: 150px;   /* or */ width: "150px"; 
height: 50%;   /* or */ height: "50%"; 
font-family: Verdana; /* or */ font-family: "Verdana"; 

回答

11

如果属性值中有空格,则只需使用引号。实际上,我认为可能出现的唯一情况是字体名称和URL。

例子:

font-family: "DejaVu Sans", sans-serif; 
+1

url中,没有必要http://stackoverflow.com/questions/2034575/which-type-of-quotes-we-should-use-in-css-background-url - 单双层/ 2034587#2034587 – 2010-05-25 01:48:23