英文:
VS Code intellisense crossing some CSS properties
问题
看看 grid-row-gap
属性:
为什么VS Code显示一些元素带有一个十字,比如这张图片中的 grid-row-gap
?我必须使用它,但它的效果不会显示。
我想使用 grid-row-gap
和 grid-column-gap
属性,但我不能。
英文:
Look at the grid-row-gap
property:
<a href="https://i.stack.imgur.com/szM1f.png"><img src="https://i.stack.imgur.com/szM1f.png"></a>
Why does VS Code show some elements with a cross, like grid-row-gap
in this image? I have to use it, but its effects won't show.
I want to use the properties grid-row-gap
and grid-column-gap
, but I can't.
答案1
得分: 2
被划掉表示 - 从上下文来看 - 不再使用该属性。
在grid-row-gap
的情况下,这是因为现在已经删除了属性名上的grid
前缀,以允许相同的属性与CSS flexbox布局一起使用,而不需要等效的flex-row-gap
。话虽如此:
旧名称: | 等效: |
---|---|
grid-column-gap | row-gap |
grid-row-gap | column-gap |
顺便说一下,如果您将该选项输入到文档中,然后将鼠标悬停在上面,您将看到以下消息:
属性已过时。请避免使用。
指定网格行之间的间距。已被'row-gap'属性替代。
(Firefox 52, Chrome 57, Safari 10, Opera 44)
英文:
Being crossed out indicates – from context – that the property is no longer to be used.
In the case of grid-row-gap
this is because the property-name now has the grid
prefix removed, in order to allow the same property to be used with CSS flexbox layout, instead of necessitating a flex-row-gap
equivalent. That being said:
old name: | equivalent: |
---|---|
grid-column-gap | row-gap |
grid-row-gap | column-gap |
Incidentally, if you'd entered that option into the document, and then hovered over it, you would have seen the message:
> Property is obsolete. Avoid using it.
>
> Specifies the gutters between grid rows. Replaced by 'row-gap' property.
>
>(Firefox 52, Chrome 57, Safari 10, Opera 44)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论