• 【FreeCodeCamp】 ResponsiveWebDesign网页设计 测试3学习笔记


    Learn CSS Color by Building a Set of Colored Markers

    https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-css-colors-by-building-a-set-of-colored-markers/step-1

    Selecting the correct colors for your webpage can greatly improve the aesthetic appeal to your readers.

    In this course, you'll build a set of colored markers. You'll learn different ways to set color values and how to pair colors with each other.

    知识点记录:

    1. in the class attribute and separating them with a space

      <div class="animal dog">
      
    2. color    三级颜色好好看!

      There are three more tertiary colors: chartreuse green (green + yellow), azure (blue + cyan), and rose (red + magenta).

      1. .one {
      2. background-color: rgb(255, 127, 0);
      3. }
      4. .two {
      5. background-color: rgb(0, 255, 127);
      6. }
      7. .three {
      8. background-color: rgb(127, 0, 255);
      9. }
      10. /*另外三级颜色也很好看*/
      11. .one {
      12. background-color: rgb(127, 255, 0);
      13. }
      14. .two {
      15. background-color: rgb(0, 127, 255);
      16. }
      17. .three {
      18. background-color: rgb(255, 0, 127);
    3. hexadecimal or hex values

      [ˌheksəˈdesɪml]

      What Is Hexadecimal?

    4. hsl

      1. element{
      2. color : hsl(hue,saturation,lightness);
      3. color: hsl(0, 100%, 30%);
      4. }

      css 中hsl颜色的意义_hsl()函数以及CSS中的示例_cumubi7453的博客-CSDN博客

      • 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. It is determined within a percent.

        饱和度 :饱和度,顾名思义,指定颜色的饱和度。 确定在一个百分比之内。

      • LIGHTNESS: Lightness is not that tough to understand, it is used to set the lightness of the color. It is also determined within a percent.

        亮度 :亮度不是很难理解的,它用于设置颜色的亮度。 也确定在一个百分比之内。

        css 中hsl(),CSS hsl() Function_人生没有续集的博客-CSDN博客

    5. 渐变

      One thing to remember is that the linear-gradientfunction actually creates an imageelement, and is usually paired with the backgroundproperty which can accept an image as a value.创建一个表示两种或多种颜色线性渐变的图片

      1. linear-gradient(gradientDirection, color1, color2, ...);
      2. /* 从上到下,蓝色渐变到红色 */
      3. linear-gradient(blue, red);
      4. /* 渐变轴为45度,从蓝色渐变到红色 */
      5. linear-gradient(45deg, blue, red);
      6. /* 从右下到左上、从蓝色渐变到红色 */
      7. linear-gradient(to left top, blue, red);
      8. /* 从下到上,从蓝色开始渐变、到高度40%位置是绿色渐变开始、最后以红色结束 */
      9. linear-gradient(0deg, blue, green 40%, red);
      10. /* 使用rgb进行颜色表示 */
      11. .red {
      12. background: linear-gradient(90deg, rgb(255, 0, 0), rgb(0,255,0));
      13. }

      创建一个线性渐变,需要指定两种颜色,还可以实现不同方向(指定为一个角度)的渐变效果,如果不指定方向,默认从上到下渐变。

      CSS linear-gradient() 函数

      color-stops 中间颜色点在颜色后面加百分比

      CSS3 - color-stops

      linear-gradient(180deg, rgb(255, 0, 0) 0%, rgb(0, 255, 0) 50%, rgb(0, 0, 255) 100%)
      

      Colors and stops tell the browser which colors to use in the gradients, and where they should stop.

    6. 透明度

      1. /* way 01*/
      2. opacity: 0.5;
      3. /* way 02 use alpha*/
      4. rgba(redValue, greenValue, blueValue, alphaValue);
    7. when two block elements are next to each other, they stack like actual blocks.

      1. <div class="marker red">
      2. <div class="cap"></div>
      3. <div class="sleeve"></div>
      4. </div>

      当新添加一个没有设置颜色的cap在sleeve上面时,就看不见sleeve了(外联元素换行了)

      1. .cap,.sleeve{
      2. display:inline-block;
      3. }

      当设置了内联就出现了

    8. border

      1. border-left-width: 10px;
      2. border-left-style: solid;
      3. border-left-color: black;
      4. /* the content before can simplify use the format bellow*/
      5. border-left:10px solid black;
    9. box-shadow

  • 相关阅读:
    Android逆向学习(二)vscode进行双开与图标修改
    mac、windows 电脑安装使用多个版本的node
    企业IT管理岗的首选认证:ITIL®4 Foundation
    Hyper-V 虚拟机CentOS配置网络(三)
    Serilog日志框架
    聊聊DisposableBeanAdapter
    nuitka 打包成exe文件怎么样打包可以不需要安装python环境运行
    题目0099-计算堆栈中的剩余数字
    web前端开发基础---制作表单类页面
    wordpress图片压缩插件-免费批量wordpress图片压缩
  • 原文地址:https://blog.csdn.net/hcud024/article/details/127651204