css中hsla代表
Introduction:
介绍:
The use of functions is very beneficial for web development and one must learn as many functions as they can, therefore keep learning functions for improving your knowledge and coding skills. Besides, you should not just learn about them but instead, you should implement in your codes, this way you will get familiar with the behavior of that particular function and you will be habitual to use more functions in near future. As you might already know, the more you code the more your skills will get enhanced and more the chances of becoming professional coders. In today's world, it is really hard to find good coders. So code hard and become a successful coder.
使用功能对Web开发非常有好处,必须学习尽可能多的功能,因此请继续学习功能以提高您的知识和编码技能。 此外,您不仅应该了解它们,还应该在代码中实现,这样您将熟悉该特定功能的行为,并且习惯于在不久的将来使用更多功能。 您可能已经知道,编码越多,您的技能就会得到增强,成为专业编码员的机会也就越大。 在当今世界,很难找到优秀的编码员。 因此努力编码,并成为成功的编码员。
Now, that we are talking about functions so much, why don't we talk about a very popular function known as the hsla() function and understand its behavior and values? Rest assured, while using this function your line of code will reduce and you would want to use this function again and again. So to get a better insight into this function to let us have a look at its definition and its syntax.
现在,我们讨论了很多函数,为什么不讨论一个非常流行的函数hsla()并了解它的行为和值呢? 放心,在使用此功能时,您的代码行将减少,并且您想一次又一次地使用此功能。 因此,为了更好地了解此功能,让我们看一下它的定义和语法。
Definition:
定义:
The hsla() function could be referred to as an extension of the hsl() function, the hsl() function as you might already know that HSL stands for Hue Saturation and Light component while hsla stands for Hue Saturation Lightness and Alpha. The alpha is the extra factor in the Hsla function. Similar to hsl() function, the hsla() function is also used to specify different values of colors. Now, let us have a look at the syntax of this function:
高强度低合金钢()函数可以作为的延伸被称为HSL()函数中, HSL()函数正如你可能已经知道,HSL代表色相饱和度和轻分量,而高强度低合金钢代表色相饱和度亮度和Alpha。 Alpha是Hsla函数中的额外因素。 类似于HSL()函数中,HSLA()函数也被用于指定的颜色不同的值。 现在,让我们看一下该函数的语法:
Syntax:
句法:
element{
color: hsla(hue,saturation,lightness,alpha)
}
Values:
值:
Let us understand each of these values one by one,
让我们一一理解这些价值观,
HUE: Hue is a container that lets you set the color from a color wheel.
HUE:色调是一个容器,可以让您设置一个色轮的色彩。
SATURATION: Saturation, as the name suggests, specifies the saturation of the color. Its value varies between 0% too 100%.
饱和度 :饱和度,顾名思义,指定颜色的饱和度。 其值在0%到100%之间变化。
LIGHTNESS: Lightness is not that tough to understand, it is used to set the lightness of the color. Its value varies between 0% too 100%.
亮度 :亮度不是很难理解的,它用于设置颜色的亮度。 其值在0%到100%之间变化。
ALPHA: Alpha value is used to set the opacity of a particular color. Its value varies between 0(fully transparent) to 1(fully opaque).
ALPHA :Alpha值用于设置特定颜色的不透明度。 其值在0(完全透明)到1(完全不透明)之间变化。
Example:
例:
<!DOCTYPE html> <html> <head> <style> p { background-color: hsla(50, 90%, 50%, 0.5); font-size: 50px; color: hsla(0, 100%, 30%, 0.7); } </style> </head> <body> <p>My name is Anjali Singh.</p> </body> </html>
Output
输出量
In the above example, the opacity of the background color is set to 0.5 and the font is set to 0.7.
在上面的示例中,背景色的不透明度设置为0.5 ,字体设置为0.7 。
Conclusion:
结论:
Now, that you have learned about the wonders of this function then what are you waiting for? You have the Syntax and the Example go ahead and start implementing it right away and don't forget to play with various colors and all of their shades. In case you fall in some doubt, just come back and go through the article once again.
现在,您已经了解了此功能的奇妙之处,然后还等什么呢? 您已经有了“语法”和“示例”,并立即开始实施它,不要忘了使用各种颜色及其所有阴影。 如果您有任何疑问,请回来并再次阅读本文。
TOP Interview Coding Problems/Challenges
最佳面试编码问题/挑战
Run-length encoding (find/print frequency of letters in a string)
游程编码(字符串中字母的查找/打印频率)
Sort an array of 0's, 1's and 2's in linear time complexity
以线性时间复杂度对0、1和2的数组进行排序
Checking Anagrams (check whether two string is anagrams or not)
检查字谜(检查两个字符串是否是字谜)
Relative sorting algorithm
相对排序算法
Finding subarray with given sum
查找给定总和的子数组
Find the level in a binary tree with given sum K
在给定总和K的二叉树中找到级别
Check whether a Binary Tree is BST (Binary Search Tree) or not
检查二叉树是否为BST(二叉搜索树)
1[0]1 Pattern Count
1 [0] 1个样式计数
Capitalize first and last letter of each word in a line
大写一行中每个单词的第一个和最后一个字母
Print vertical sum of a binary tree
打印二叉树的垂直和
Print Boundary Sum of a Binary Tree
打印二叉树的边界和
Reverse a single linked list
反转单个链表
Greedy Strategy to solve major algorithm problems
解决主要算法问题的贪婪策略
Job sequencing problem
工作排序问题
Root to leaf Path Sum
根到叶的路径总和
Exit Point in a Matrix
矩阵中的出口点
Find length of loop in a linked list
在链表中查找循环长度
Toppers of Class
一流的礼帽
Print All Nodes that don't have Sibling
打印所有没有兄弟的节点
Transform to Sum Tree
转换为求和树
Shortest Source to Destination Path
最短的源到目标路径
Comments and Discussions
Ad: Are you a blogger? Join our Blogging forum.
评论和讨论
广告:您是博主吗? 加入我们的Blogging论坛 。
翻译自: https://www.includehelp.com/code-snippets/hsla-function-with-example-in-css.aspx
css中hsla代表