gpt4 book ai didi

css - CSS中名词 "style"的定义是什么?

转载 作者:行者123 更新时间:2023-11-28 19:20:27 25 4
gpt4 key购买 nike

名词“样式”(复数“样式”)在 CSS 上下文中的确切含义是什么?

我看过一些术语/词汇表页面,但它们似乎没有涵盖这个词:


这是一个术语定义的例子,这正是我要找的:

选择器
选择器是 CSS 行的一部分,它选择要使用属性/值对定位的元素。在下面的示例中,“#container #box”是选择器:

/* the selector is everything on the first line */
/* excluding the opening curly brace */
#container #box {
width: 200px;
}

最佳答案

我得到的最接近答案的是“样式”指的是声明:

.a {
/*┏━━━━━ Style aka Declaration ━━━━━━┓ */
background-color: mediumspringgreen;
}

因此“样式”指的是多个声明。

我基于口语用法:

Property: The style that you are applying to a selector, e.g. border.
Selector: The way you declare which elements the styles should apply to.

引用:http://nimbupani.com/css-vocabulary.html


an element that has a class of “navigation” will receive the declared styles.

引用:https://www.impressivewebs.com/css-terms-definitions/


div[attrib^="1"] { /* styles here */ }

引用:https://www.hongkiat.com/blog/css-back-to-basics-terminology-explained/

另一种定义似乎是指“文档样式”或“全局样式”,如 the CSS1 Spec ,虽然这并不常见:

CSS1 is a simple style sheet mechanism that allows authors and readers to attach style (e.g. fonts, colors and spacing) to HTML documents.

关于css - CSS中名词 "style"的定义是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57397362/

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