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

CSS中box-shadow与margin属性无效,浏览器提示无效属性值求助

Fixing Invalid Property Value for box-shadow and margin on .card-grey Divs

Hey there! Let's get your card styles working properly. The root cause of your "Invalid property value" error is actually a tiny typo in your CSS selector that's making the entire rule unrecognizable to the browser.

The Problem: Invalid CSS Selector

Take a look at your .card-grey rule in the CSS:

**.card-grey { background-color : #36393F; margin:30px; box-shadow: 5px 5px 10px yellow;** }

You’ve added extra ** at the start and end of the selector block. These asterisks aren’t valid syntax for a CSS class selector—they break the entire rule, so the browser ignores all the properties inside (including margin and box-shadow).

The Fix

Just remove those extra asterisks, and your CSS rule will work as expected. Here’s the corrected version:

.card-grey { 
  background-color: #36393F; 
  margin: 30px; 
  box-shadow: 5px 5px 10px yellow; 
}

Bonus: Minor HTML Fix

While it’s not causing your current style issue, you have an unclosed <meta> tag in your HTML head. This can lead to unexpected rendering quirks later, so fix it by adding a closing />:

<meta name="Description" content="Bienvenue sur le profil de x, alias x" />

Once you make these changes, refresh your browser, and you’ll see the margin spacing between cards and the yellow box-shadow appear as intended.

内容的提问来源于stack exchange,提问作者Philippe

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.11 07:25:28