gpt4 book ai didi

CSS 术语 : what's this called in a property value?

转载 作者:太空宇宙 更新时间:2023-11-04 00:18:49 25 4
gpt4 key购买 nike

在 css 属性中,有一些看起来像函数的值声明,例如

background: rgba(0,0,0,0);

background-image: url('bg.png');

第一部分称为属性,例如backgroundbackground-image。第二部分通常称为值。但是括号外的部分叫什么,例如 rgba(...)url(...)

谢谢!

最佳答案

一般来说,它们只是称为“ notations”;见 this part of the spec例如:

The image() function allows an author to:

  • use media fragments to clip out a portion of an image
  • specify fallback images in case the preferred image can't be decoded or is a type that > the browser doesn't recognize
  • use a solid color as an image
  • annotate an image with a directionality

The image() notation is defined as:

<image-list> = image( [ <image-decl> , ]* [ <image-decl> | <color> ] )
<image-decl> = [ <url> | <string> | <element-reference> ]

Each <string> or <url> inside image() represents an image, just as if the url() notation had been used. As usual for URLs in CSS, relative URLs are resolved to an absolute URL (as described in Values & Units [CSS3VAL]) when a specified image() value is computed.

所以 url('bg.png')url()符号。但是,您可以获得更具体的信息。表示图像的值,例如:

  • linear-gradient(red, white)
  • url('../images/hello.png')
  • radial-gradient(orange, yellow)
  • cross-fade(image1, image2)

称为图像值。这适用于 rect() 之类的东西,也是一个 shape value 1。至于calc() ,我相信这通常被称为表达式。

1 请注意,在边栏中,rect()也称为函数。

关于CSS 术语 : what's this called in a property value?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10116577/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com