CSS代码border-radius行报‘expected COLON’错误,但冒号已正确放置
CSS报错修复:expected COLON at line 49, col 4问题
你的CSS代码报错提示expected COLON at line 49, col 4,指向border-radius行,但肉眼看冒号没问题,问题出在全角空格上:
你代码里的border-radius行开头用的是全角空格(中文输入法下的空格),CSS解析器只识别半角空格,它会把全角空格当成属性名的一部分,导致解析时认为属性名不合法,找不到应有的冒号。
修复方法
把border-radius行开头的全角空格替换成半角空格(英文输入法下的空格),修正后的代码如下:
div.term-description h3{ padding: 0px; /* removes the default padding so we can add our own sizing */ } div.term-description h3 span a, div.term-description h3 a span{ display: inline-block; background-color: #0369a1; /* Set the background color in HEX here */ color: white !important; /* Set the text color (we need to add an 'important' to override the HTML level styling already applied */ padding: 8px 20px; /* This is the space around the text, first number is y axis and second x */ margin-bottom: 6px; /* Space between each heading */ border: solid 2px #0369a1; /* You can use this to add a border (style, width, color) */ border-radius: 50px; /* This give the rounded edges, you can use px or % here */ transition: all 0.3s ease; /* Sets the transition for hover effects, change the middle option for timing */ }
内容的提问来源于stack exchange,提问作者Jerome
相关产品推荐
相关产品推荐

