HTML&中的单引号与双引号的CSS [英] Single versus double quotation marks in HTML & CSS

查看:280
本文介绍了HTML&中的单引号与双引号的CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能澄清HTML5&中单引号和双引号之间的区别? CSS.

Could anyone clarify the difference between single and double quotation marks in HTML5 & CSS.

以下是Google在HTML中对单引号的矛盾用法:

Here's Google's contradictory use of single quotes in HTML:

<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>

和CSS:

font-family: 'Roboto', sans-serif;

Bootstrap的文档编制实践演示了HTML中双引号的使用:

While Bootstrap's documentation practices demonstrate the use of double quoted marks in HTML:

<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">

和CSS:

font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;

哪种做法是最佳为什么?

Google字体决定使用单引号有什么正当理由吗?

Is there any valid reason why Google Fonts decided to use single quotes ?

推荐答案

两者均有效,但您可能应该遵循特定的样式指南.例如, Google的样式指南建议使用 CSS的单引号. (尽管Google字体不能完全遵循此要求)

Either are valid, but you probably should stick to a certain style guide. For example, Google's style guide suggest using double quotes for HTML and single quotes for CSS. (Although Google Fonts doesn't follow this exactly)

这篇关于HTML&amp;中的单引号与双引号的CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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