You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 18:42:11