是否有一个css属性,它什么也不会改变,而且我们可以在哪里存储信息? [英] Are there a css property that would change nothing and where we can store information?

查看:34
本文介绍了是否有一个css属性,它什么也不会改变,而且我们可以在哪里存储信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有css属性不会改变什么吗?

Are there a css property that would change nothing?

在编写 scss 时,经常会出于测试目的而需要它,只是为了确保我正确创建了一个CSS选择器.例如,我很高兴拥有这样的 foo:"helloworld1"; ,以后我就可以更改 foo 的值并检查值,以查看我的选择器确实达到了正确的元素.

I need this for testing purposes very often when writing scss just to see that I created a css selector correctly. For instance, I would be glad to have something like this foo: "helloworld1"; and later on I would be able to change the value of the foo and check the value in the developer tools to see that my selectors have indeed reached a correct element.

我考虑过使用 width:auto; ,但有时会指定宽度(例如 width:100px; ).

I thought about using the width: auto;, but sometimes the width is specified (e.g. width: 100px;).

推荐答案

使用

自定义属性仅供作者和用户使用;CSS绝不会赋予它们超出此处所提供含义的含义.

Custom properties are solely for use by authors and users; CSS will never give them a meaning beyond what is presented here.

自定义属性是普通属性,因此可以在任何元素上声明它们,使用常规继承和级联规则进行解析,可以使用@media和其他条件规则进行条件设置,可以在HTML的style属性中使用,可以使用CSSOM等读取或设置.

Custom properties are ordinary properties, so they can be declared on any element, are resolved with the normal inheritance and cascade rules, can be made conditional with @media and other conditional rules, can be used in HTML’s style attribute, can be read or set using the CSSOM, etc.

这篇关于是否有一个css属性,它什么也不会改变,而且我们可以在哪里存储信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆