简体   繁体   English

无效的属性值CSS值

[英]Invalid Property Value Css value

I have tried the below CSS in multiple browsers and am not having success using the grid-template-columns attribute. 我已经在多种浏览器中尝试了以下CSS,但是使用grid-template-columns属性没有成功。

.container {
  background-color: azure;
  display: grid;
  grid-template-columns: 1fr, 1fr, 1fr;
}

The CSS is throwing an error indicating the grid-template-columns is invalid. CSS抛出错误,指示grid-template-columns无效。

That is not the syntax of grid-template-columns values. 那不是grid-template-columns值的语法。 All you need to do is remove the commas. 您需要做的就是删除逗号。

 .container { background-color: azure; display: grid; grid-template-columns: 1fr 1fr 1fr; } 
 <div class="container"> <div class="box">1</div> <div class="box">2</div> <div class="box">3</div> </div> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM