Html CSS 无效的属性值
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32515519/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CSS Invalid Property Value
提问by Skripsi Rico
I don't understand what's wrong with this? Google Chrome give this "CSS Invalid Property Value".
我不明白这有什么问题?谷歌浏览器给出了这个“CSS 无效的属性值”。
<h2 class="grid-100" style="font: 'ralewaybold' 35px !important"><span>Portee</span> Goods</h2>
How to fix its?
如何修复它?
回答by Rohit Azad
your Font Shorthand property is not valid
您的字体速记属性无效
The font CSSproperty is either a shorthandproperty for setting font-style
, font-variant
, font-weight
, font-size
, line-height
and font-family
, or a way to set the element's
font
to a system font, using specifickeywords.
字体CSS属性是一个速记设置属性font-style
,font-variant
,font-weight
,font-size
,line-height
和font-family
,或方法来设置element's
font
到系统的字体,使用特定的关键字。
Syntax
句法
h2{
font: font-style font-variant font-weight font-size/line-height font-family;
}
In Use
正在使用
h2{
font: italic small-caps normal 13px/150% Arial, Helvetica, sans-serif;
}
More about the shorthand font perperty
or used to this
或者习惯了
/* size | family */
/* 大小 | 家庭 */
font: 2em "Open Sans", sans-serif;
/* style | size | family */
/* 样式 | 尺寸 | 家庭 */
font: italic 2em "Open Sans", sans-serif;
/* style | variant | weight | size/line-height | family */
/* 样式 | 变体 | 重量 | 大小/行高| 家庭 */
font: italic small-caps bolder 16px/3 cursive;
/* The font used in system dialogs */
/* 系统对话框中使用的字体 */
font: message-box;
/* Global values */
/* 全局值 */
font: inherit;
font: initial;
font: unset;
回答by Lance
Swap the order. The order of the shorthand matters.
交换顺序。速记的顺序很重要。
<h2 class="grid-100" style="font: 35px 'ralewaybold' !important;">
回答by Lance
please try this one:
请试试这个:
please Add in it:font-size:35px !important;
请加入:font-size:35px !important;
<h2 class="grid-100" style="font: ralewaybold; font-size:35px !important;"><span>Portee</span> Goods</h2>
回答by John Louie Dela Cruz
Try removing 35px Important
and add it in font-size: 35px !important
尝试删除35px Important
并添加它font-size: 35px !important
<h2 class="grid-100" style="font: 'ralewaybold'; font-size: 35px !important"><span>Portee</span> Goods</h2>
回答by Amit singh
I think you missed the ;
at the last..
我想你;
最后错过了..
Your HTML
你的 HTML
<h2 class="grid-100" style="font: 'ralewaybold' 35px !important"><span>Portee</span> Goods</h2>
Updated HTML
更新的 HTML
<h2 class="grid-100" style="font: ralewaybold 35px !important;"><span>Portee</span> Goods</h2>