我应该在CSS中使用什么引号? [英] What Quotation Marks Should I Use In CSS?

查看:116
本文介绍了我应该在CSS中使用什么引号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
应该使用哪种类型的引号在CSS背景网址(“…”)中使用?

Possible Duplicate:
Which type of quotes we should use in css background url (“…”)? Single, double or no quote needed?

一个简单的问题.我应该在CSS中使用什么引号?

Simple question. What quotation marks should I use in CSS?

选项1:

background: url( 'foo.png' );

选项2:

background: url( "foo.png" );

两者都可以在普通浏览器"上使用.我只想遵循这些标准.

Both works on "normal browsers". I just want to follow the standards.

推荐答案

标准说 :

URI值的格式为'url(',后跟可选的空格,后跟可选的单引号(')或双引号()字符,后跟URI本身,然后是可选的单引号(')或双引号()字符,后跟可选空格,后跟')'.两个引号字符必须相同.

The format of a URI value is 'url(' followed by optional white space followed by an optional single quote (') or double quote (") character followed by the URI itself, followed by an optional single quote (') or double quote (") character followed by optional white space followed by ')'. The two quote characters must be the same.

即无,单或双.如果您在意IE5/Mac(如今可能不太喜欢),请避免使用',否则请使用使您感到舒适的任何东西.

i.e. none, single or double. If you care about IE5/Mac (which you probably don't these days) avoid ', otherwise use whatever makes you comfortable.

这篇关于我应该在CSS中使用什么引号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆