跳转到主要内容
你行网

Main navigation

  • 首页
  • Drupal
  • 编程与开发
  • 数据库
  • 操作系统与应用
  • 服务器与运维
  • 社区
User account menu
  • 登录

面包屑

  1. 首页

CSS 基础学习-022 CSS样式设置rgba颜色值

由 hrs, 19 四月, 2021

rgba颜色值是具有 alpha 通道的 RGB 颜色值的扩展 - 它指定了颜色的不透明度。其格式为:rgba(red, green, blue, alpha),alpha 参数是介于 0.0(完全透明)和 1.0(完全不透明)之间的数字。

实例代码:

  1 <!doctype html>
  2 <html>
  3   <head>
  4     <meta charset="utf-8">
  5     <style>
  6       h1{
  7         color:black;
  8         width:350px;
  9         padding:10px;
 10 
 11       }
 12     </style>
 13   </head>
 14   <body>
 15     <h2>rgba颜色实例</h2>
 16     <h1 style="background-color:rgba(255,99,71,0);">rgba(255,99,71,0)</h1>
 17     <h1 style="background-color:rgba(255,99,71,0.2);">rgba(255,99,71,0.2)</h    1>
 18     <h1 style="background-color:rgba(255,99,71,0.4);">rgba(255,99,71,0.4)</h    1>
 19     <h1 style="background-color:rgba(255,99,71,0.6);">rgba(255,99,71,0.6)</h    1>
 20     <h1 style="background-color:rgba(255,99,71,0.8);">rgba(255,99,71,0.8)</h    1>
 21     <h1 style="background-color:rgba(255,99,71,1);">rgba(255,99,71,1)</h1>
 22     <p>你可以通过使用RGBA颜色值来生成透明色</p>
 23   </body>
 24 </html>
~            

运行效果:

css-022.png

 

  • 登录或注册以发表评论
内容类型分类
编程与开发
文章归类
前端开发

文章标签

  • CSS

评论

文章标签

Excel
CSS
ubuntu
php
vim
五笔
VPN
Linux
command
HTML
drupal 8
centos
drupal 7
composer
Mysql
模块(module)
drush
Drupal
JavaSrcipt
apache
英语
drupal 9
nerdtree
network
果树种植
surround
drupal10
SEO
主题(theme)
二进制
更多

相关文章

  • php json_encode 函数将编码值转为json格式
  • php 用户自定义回调函数实例
  • php 回调函数实例
  • 匿名函数(Anonymous Functions)详解
  • 如何去掉input和button标签中间有缝隙
  • PHP 中的四种标量数据类型
  • php 语言的四种标记风格
  • date_default_timezone_set 设置php服务器的默认时区
  • php8.3 的扩展模块简略说明
  • <input>` 类型的定义和用途的简要说明
RSS源

友情链接 网站地图 版权信息 联系我们 网址导航 社区

Copyright © 2019 - 2021 你行网 版权所有  粤ICP备19072650号-1