this
background:url(http://url);
this
background:url("http://url");
or this
background:url('http://url');
根据以下规定,所有三个示例的 URL 位都是有效的 CSSCSS规范 http://www.w3.org/TR/CSS21/syndata.html#uri.
请注意,规范标识了 URL 中的某些字符,如果存在,则需要使用反斜杠进行转义in an unquoted URI, such as parentheses, commas, white space characters, single quotes (') and double quotes (").
因此,您可能会发现最好在 URL 周围使用单引号或双引号。
请注意,您需要按照以下格式编写完整的 CSS 属性:
background: url( http://example.com );
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)