CSS中的特效-详解

目录

常见样式参考表

特殊样式

媒体查询

自定义字体

变换效果 transform

translate() 方法

rotate() 方法

scale() 方法

skew() 方法

matrix() 方法

过渡效果 transition

动画效果 @keyframes animate

渐变效果

background-image:linear-gradient

background-image:radius-gradient

多列效果 column-count

字体图标(icon)


常见样式参考表

样式名称样式的值说明
font-family字体名称(如微软雅黑or Microsoft YaHei)文本字体
font-stylenormal、italic、oblique规定斜体文本
font-variantsmall-caps、normal小型大写字母
font-weightnormal、bold、bolder、数值文本的粗细
font-size默认大小是 16 像素 (16px=1em),单位一般是px,也可以是其他文本的大小
text-indent所有元素的第一行都可以缩进一个给定的长度,该长度可以是负值软化文本内容
text-alignleft、right 、center、justify文本行间的对齐方式
word-spacing其默认值 normal 与设置值为 0 是一样的改变单词间隔
letter-spacing其默认值 normal 与设置值为 0 是一样的改变字(字母)间隔
text-transformnone、uppercase、lowercase、capitalize处理文本的大小写
text-decorationnone、underline、overline、line-through、blink文本装饰
white-spacenormal、pre-line、nowrap、pre、pre-wrap空格换行和tab 处理
color#十六进制三原色、颜色单词、rgb函数、rgba函数文本颜色
direction默认ltr、rtl、inherit文本的方向
line-heightnormal、数值、%等行高
text-shadowh1 { text-shadow: 5px 5px 5px #FF0000; }文本阴影效果
box-shadowdiv{ text-shadow: 5px 5px 5px #FF0000; }盒子阴影效果
list-style-typedisc、circle、square、decimal、lower-roman、lower-latin列表的样式
list-style-imageurl函数引入图片列表图标
list-style-positioninside、outside、inherit何处放置列表项标记
list-stylelist-style:square inside url('imgs/point.png');统一设置列表样式
outlinep { outline:#00FF00 dotted thick; }轮廓线
outline-offset数值轮廓和元素的距离
outline-color#十六进制三原色、颜色单词、rgb函数、rgba函数轮廓颜色
outline-styledotted、solid、dashed、double等轮廓样式
outline-widththin(细)、medium(默认)、thick(粗)、数值轮廓的宽度
border-imagediv { border-image:url(border.png) 30 30 round;}使用图片来创建边框
opacity0~1之间的数值,0表示全透明,1表示不透明透明度
width数值元素的宽度
height数值元素的高度
max-height数值最大高度
max-width数值最大宽度
min-height数值最小高度
min-width数值最小高度
margin{margin: 0px; margin: 10px 20px; margin: 10px 20px 30px 0px; margin: auto;}外边距
margin-left数值左外边距
margin-right数值右外边距
margin-top数值上外边距
margin-bottom数值下外边距
padding{padding: 0px; padding: 10px 20px; padding: 10px 20px 30px 0px; }内边距
padding-xx和margin一致也有四个
borderborder: 1px solid red;边线
border-width数值边线粗细
border-styledotted、dashed、solid、double边线样式
border-color#十六进制三原色、颜色单词、rgb函数、rgba函数颜色
border-xx-xxborder-top-width: 15px样式、颜色、粗细
border-radiusdiv { border:2px solid; border-radius:25px; },数值或者百分比边线的弧度
background{ background: #00FF00 url(bgimage.gif) no-repeat fixed top; }背景综合写法
background-color#十六进制三原色、颜色单词、rgb函数、rgba函数背景颜色
background-positiontop left 这种单词对 或者 坐标位置(x,y)或者 x%, y%背景位置
background-sizebackground-size:80px 60px;| cover背景图像的尺寸
background-repeatrepeat、repeat-x、repeat-y、no-repeat背景图像重复
background-imageurl函数引入图片背景图片
background-attachment默认scroll、fixed背景图像是否固定或者随页面的滚动
visibilityvisible、hidden元素是否可见
displaynone、block、inline、inline-block、list-item元素类型转换、可见性
positionstatic、relative、absolute、fixed元素定位
z-index数值,默认0表示z轴的优先级
vertical-alignbaseline、sub、super、top、text-top、middle、text-bottom元素的垂直对齐方式
overflowvisible、hidden、scroll、auto溢出元素框时处理
clearleft、right、both、none清除浮动
floatleft、right、none元素在哪个方向浮动
resizenone、both、horizontal、vertical规定是否调整元素尺寸
box-sizingcontent-box、border-box容器尺寸计算方式
filteropacity()、url()、blur()、grayscale()、brightness()等函数设置页面的滤镜

案例详解:

body {/*background-color: #666666;*/
}
.content {width: 600px;font-family: "微软雅黑","宋体";font-size: 16px;line-height: 35px;/*font-weight: bold;*/text-shadow: -5px -5px 2px #317FE5;   /* offset-x | offset-y | blur-radius | color */position: fixed;top: 0;left: 0;
}
​
.box {margin: 30px auto;width: 700px;height: 100px;background-color: grey;color: white;/*text-align: justify;*/word-spacing: 10px;letter-spacing: 5px;text-transform: lowercase;text-decoration: underline;direction: inherit;box-shadow: 5px 5px 5px[阴影的模糊程度] #ff0000;   /* offset-x | offset-y | blur-radius | color */
​/*border: 2px solid green;*/border-width: 2px;border-style: solid;border-color: green;/*border-radius: 5px;*/
​border-bottom-left-radius: 5px;border-top-right-radius: 15px;
​/*visibility: hidden;*//*display: none;*/
}
​
input {outline: blue 1px solid;
}
​
.box1 {margin-top: 30px;width: 300px;height: 300px;/*background-color: #317FE5;*/border-radius: 50%;background: #317FE5 url("../image/5.jpeg") left top;
}
​
.box2 {margin: 30px;width: 700px;height: 300px;border: 1px solid red;background: url("../image/mybatis-logo.png") no-repeat 50px 5px;
}

页面:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>常见样式的使用</title><link rel="stylesheet" href="css/index.css">
</head>
<body>
<div class="content">
中新网2月20日电 据香港《明报》报道,澳门赌王何鸿燊与三太陈婉珍的27岁儿子何猷启,被视为“城中钻石笋盘”,家底丰厚兼遗传了赌王的帅气。2018年农历新年,他公布向内地女友GiGi求婚成功,随后传媒追问他有关婚礼的安排却低调避谈。
</div>
<div class="box">澳门赌王何鸿燊与三太陈婉珍的27岁儿子何猷启,hello HTML css</div>
​
<input type="text" name="username" placeholder="姓名">
​
<div class="box1"></div>
​
<div class="box2"></div>
</body>
</html>

特殊样式

媒体查询

        有时,我们需要显示的区域根据不同设备显示不一样的效果,这时就可以使用媒体查询。而使用媒体查询我们就需要用到 @media 来实现。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>媒体查询</title><style>.box{width: 100%;height: 500px;background-color: #317FE5;}@media screen and (max-width: 500px) {.box {background-color: red;}}@media screen and (min-width: 768px){.box {background-color: blue;}}@media screen and (min-width: 1200px){.box {background-color: #C44F00;}}</style>
</head>
<body>
<div class="box"></div>
</body>
</html>

自定义字体

        由于浏览器默认的使用的字体是微软雅黑,但有时候我们希望使用我们自己指定的字体,这时就需要使用 @font-face 来实现。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>字体的使用</title><style>/*指定自定义字体*/@font-face {/*自定义字体名称*/font-family: myfont;src: url("./font/ttf/JetBrainsMono-Bold.ttf"), url("./font/ttf/JetBrainsMono-Italic.ttf");}/* 使用自定义字体 */.box {font-family: myfont;}</style>
</head>
<body>
<div class="box">澳门赌王何鸿燊与三太陈婉珍的27岁儿子何猷启</div>
</body>
</html>

变换效果 transform

在 CSS 中有以下几种变换效果:

  • translate():移动

  • rotate():旋转

  • scale():缩放

  • skew(): 翻转

  • matrix() 综合

translate() 方法

它是一种平移效果,元素从某个位置移动到另一个位置。在使用过程中,需要通过 x 轴和 y 轴来实现。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>translate</title><style>div {width: 200px;height: 200px;}div.box1 {background-color: #317FE5;z-index: 900000;}div.box2 {background-color: orange;/*transform: translate(200px, 30px);*//*transform: translate(100px, -100px);*//*transform: translate(50px);*//*transform: translateX(100px);*/transform: translateY(100px);z-index: 0;}</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
</body>
</html>

rotate() 方法

这个效果是让某个元素进行旋转,需要指定旋转的角度。负数为逆时针旋转,正数是顺时针旋转,旋转的单位是 deg。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>rotate</title><style>div {width: 200px;height: 200px;}div.box1 {background-color: #317FE5;transform: rotate(-20deg);}div.box2 {background-color: orange;transform: rotate(45deg);}</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
</body>
</html>

scale() 方法

这个方法的作用是让某个元素的尺寸增加或减少,会根据给定的宽度(x轴)和高度(y 轴)来进行变化。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>scale</title><style>div {width: 200px;height: 200px;}div.box1 {background-color: #317FE5;transform: scale(0.5, 0.5);}div.box2 {background-color: orange;/*transform: scale(1.5, 1.5);*//*transform: scale(2);*/transform: scaleX(2);}.container {position: absolute;left: 200px;top: 0;}</style>
</head>
<body>
<div class="container"><div class="box1"></div><div class="box2"></div>
</div>
</body>
</html>

skew() 方法

这个方法的作用是让元素翻转给定的角度,根据给定的水平线(x 轴)和垂直线(y 轴)来进行变化。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>skew</title><style>div {width: 200px;height: 200px;color: white;}div.box1 {background-color: #317FE5;}div.box2 {background-color: orange;transform: skew(30deg, 30deg);}</style>
</head>
<body>
<div class="box1">这是第一个块元素</div>
<div class="box2">这是第二个块元素</div>
</body>
</html>

matrix() 方法

这个方法可以实现前面的那几个效果。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>matrix</title><style>div {width: 200px;height: 200px;color: white;text-align: center;}div.box1 {background-color: #317FE5;}div.box2 {background-color: orange;transform: matrix(0.86, 0.5, -0.5, 0.86, 0, 0);  /* matrix(a, b, c, d, tx, ty) */}</style>
</head>
<body>
<div class="box1">这是第一个块元素</div>
<div class="box2">这是第二个块元素</div>
</body>
</html>

过渡效果 transition

从一个状态变为另一个状态的过程,要想有过渡效果,我们需要有触发条件,通常的触发条件为鼠标移动到元素上(hover)。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>单项过渡效果</title><style>.box {width: 200px;height: 200px;background-color: #317FE5;transition: width 2s;}.box:hover {width: 400px;background-color: #C44F00;}</style>
</head>
<body>
<div class="box"></div>
</body>
</html>

多项过渡:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>多项过渡效果</title><style>.box {width: 200px;height: 200px;background-color: #317FE5;/*transition: width 2s, background-color 2s, transform 2s;*/transition: all 2s;}.box:hover {width: 400px;background-color: #C44F00;transform: translateX(150px);}</style>
</head>
<body>
<div class="box"></div>
</body>
</html>

transition 这个属性的值:

属性描述
transition简写属性,用于在一个属性中设置四个过渡属性。属性对
transition-property规定应用过渡的 CSS 属性的名称。属性名称
transition-duration定义过渡效果花费的时间。默认是 0。数值(单位:秒)
transition-timing-function规定过渡效果的时间曲线。默认是 "ease"。linear、ease、ease-in等
transition-delay规定过渡效果何时开始。默认是 0。数值(单位:秒)
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>过渡效果比较</title><style>.box {width: 200px;height: 200px;background-color: #317FE5;/*transition: width 5s ease 2s;*//*transition: width 3s linear;*//*transition: width 3s ease-in;*//*transition: width 3s ease-in-out;*/transition: width 3s ease-out;}.box:hover {width: 500px;}</style>
</head>
<body>
<div class="box"></div>
</body>
</html>

动画效果 @keyframes animate

在 CSS3 中提供了基于 CSS 动画效果,我们需要先定义动画,然后再使用动画。

定义动画使用 @keyframes,而使用动画使用 animate。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>动画效果</title><style>/*.box {*//*    width: 200px;*//*    height: 200px;*//*    background: #317FE5;*//*    transition: transform 2s;*//*}*/
​/*.box:hover {*//*    transform: translateX(100px);*//*}*/
​/* 定义动画 */@keyframes myAnimate {from {left: 5px;background: #317FE5;}to {left: 500px;background: red;}}
​.box {width: 200px;height: 200px;background: #317FE5;animation: myAnimate 5s;position: absolute;left: 5px;top: 5px;}</style>
</head>
<body>
<div class="box"></div>
</body>
</html>

另一个效果:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>动画效果</title><style>/* 定义动画 */@keyframes myAnimate {0% {left: 5px;top: 5px;}25% {left: 500px;top: 5px;}50% {left: 500px;top: 200px;}75% {left: 5px;top: 200px;}100% {left: 5px;top: 5px;}}
​.box {width: 200px;height: 200px;background: #317FE5;animation: myAnimate 5s;position: absolute;left: 5px;top: 5px;}</style>
</head>
<body>
<div class="box"></div>
</body>
</html>

动画属性

属性描述
@keyframes规定动画。指定css样式
animation所有动画属性的简写属性,除了 animation-play-state 属性。动画名称
animation-name规定 @keyframes 动画的名称。动画名称
animation-duration规定动画完成一个周期所花费的秒或毫秒。默认是 0。数值
animation-timing-function规定动画的速度曲线。默认是 "ease"。ease-in-out、linear、ease、ease-in、ease-out
animation-delay规定动画何时开始。默认是 0。数值
animation-iteration-count规定动画被播放的次数。默认是 1。数值或者infinite
animation-direction规定动画是否在下一周期逆向地播放。默认是 "normal"。normal、alternate
animation-play-state规定动画是否正在运行或暂停。默认是 "running"。paused、running
animation-fill-mode规定对象动画时间之外的状态。none、forwards、backwards、both
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>动画属性介绍</title><style>.box {width: 200px;height: 200px;background: #317FE5;position: absolute;top: 5px;left: 5px;
​/*animation: myMove 5s;*//* 指定动画名称 *//*animation-name: myMove;*//* 定义动画持续时间,单位是秒或毫秒 *//*animation-duration: 3s;*//* 定义动画执行的效果 *//*animation-timing-function: ease-in;*//* 定义动画执行次数,默认为 1 次,如果希望无限次,则值为 infinite *//*animation-iteration-count: infinite;*//*animation-iteration-count: 1;*//* 定义动画的运行方向 *//*animation-direction: alternate-reverse;*//*animation-direction: alternate;*/
​/*animation-play-state: paused;*/
​animation: myMove 3s ease-in infinite alternate;
​}
​@keyframes myMove {from {/*background: #317FE5;*/left: 5px;top: 5px;}to {/*background: red;*/left: 200px;top: 5px;}}</style>
</head>
<body>
<div class="box"></div>
</body>
</html>

动画案例:定义两个圆,一个圆逆时针旋转,另一个圆顺时针旋转。

下图是定义分析

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>动画的案例</title><style>.outer {width: 300px;height: 300px;background: url("image/5.jpeg") no-repeat center center;overflow: hidden;border-radius: 50%;/*transform: translateY(50%);*/position: absolute;left: 50%;top: 50%;margin-top: -150px;margin-left: -150px;animation: outerAnimate 5s linear infinite;}.inner {width: 200px;height: 200px;background: url("image/7.jpeg") no-repeat center center;/*transform: translate(25%, 25%);*/border-radius: 50%;position: absolute;left: 50%;top: 50%;margin-left: -100px;margin-top: -100px;animation: innerAnimate 3s linear infinite;}@keyframes outerAnimate {from {transform: rotate(360deg);}to {transform: rotate(0deg);}}@keyframes innerAnimate {from {transform: rotate(0deg);}to {transform: rotate(360deg);}}</style>
</head>
<body>
<div class="outer"><div class="inner"></div>
</div>
</body>
</html>

渐变效果

background-image:linear-gradient

background-image:radius-gradient

在 CSS3 中提供了可以让两种或多种颜色 之间的显示平稳过渡。我们只需要使用 background-image: linear-gradients 属性来指定即可。它的语法为:

background-image: linear-gradient(direction, color-stop1, color-stop2,....);

简单示例:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>渐变效果1</title><style>.box {width: 500px;height: 200px;border: 1px solid #333333;/* 线性渐变,从下到上 *//*background-image: linear-gradient(#cccccc, #317FE5, #ff0000);*//* 线性渐变:从左到右 *//*background-image: linear-gradient(to right, #317FE5, #ff0000);*//* 线性渐变:从右到左 */background-image: linear-gradient(to left, #317FE5, #ff0000);}</style>
</head>
<body>
<div class="box"></div>
</body>
</html>

其它效果:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>渐变效果2</title><style>.box {width: 300px;height: 300px;margin: 50px auto;border: 1px solid #333333;border-radius: 50%;/* 可以指定渐变的角度 *//*background-image: linear-gradient(180deg, #ff0000, yellow);*/
​/* 可以指定渐变的透明度 *//*background-image: linear-gradient(to right, rgba(255,0,0,.5), rgba(255, 255, 0, 0.5));*/
​/* 重复的线性渐变 *//*background-image: linear-gradient(red, yellow 10%, green 20%);*/
​/* 径向渐变 */background-image: radial-gradient(red, yellow);}</style>
</head>
<body>
<div class="box"></div>
</body>
</html>

多列效果 column-count

在 CSS3 中提供了将文本内容设计成像报纸一样的多列布局。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>多列效果</title><style>.box {column-count: 3;}</style>
</head>
<body>
<h1>下面的数据呈现3列展示</h1>
<div class="box">“当我年轻的时候,我梦想改变这个世界;当我成熟以后,我发现我不能够改变这个世界,我将目光缩短了些,决定只改变我的国家;当我进入暮年以后,我发现我不能够改变我们的国家,我的最后愿望仅仅是改变一下我的家庭,但是,这也不可能。当我现在躺在床上,行将就木时,我突然意识到:如果一开始我仅仅去改变我自己,然后,我可能改变我的家庭;在家人的帮助和鼓励下,我可能为国家做一些事情;然后,谁知道呢?我甚至可能改变这个世界。”
</div>
</body>
</html>

字体图标(icon)

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>字体图标</title>
</head>
<body>
<h1>svg标签的使用</h1>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"><circle cx="50" cy="50" r="20" stroke="black" stroke-width="2" fill="red" />
</svg>
</body>
</html>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/633022.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

MySQL基础知识(三)

内连接 MySQL中的内连接&#xff08;Inner Join&#xff09;是一种用于合并两个或多个表中符合特定条件的行的方法。内连接返回仅在连接条件满足的情况下存在于两个表中的行。内连接通常用于检索具有相关信息的数据&#xff0c;以便将它们合并在一起。 简单来说就是通过内连接检…

2018年认证杯SPSSPRO杯数学建模A题(第二阶段)海豚与沙丁鱼全过程文档及程序

2018年认证杯SPSSPRO杯数学建模 基于聚类分析的海豚捕食合作策略 A题 海豚与沙丁鱼 原题再现&#xff1a; 沙丁鱼以聚成大群的方式来对抗海豚的捕食。由于水下光线很暗&#xff0c;所以在距离较远时&#xff0c;海豚只能使用回声定位方法来判断鱼群的整体位置&#xff0c;难…

第4章 C++的类

类的保留字&#xff1a;class、struct 或 union 可用来声明和定义类。类的声明由保留字class、struct或union加上类的名称构成。类的定义包括类的声明部分和类的由{}括起来的主体两部分构成。类的实现通常指类的函数成员的实现&#xff0c;即定义类的函数成员。 class 类名;//…

【算法题】62. 不同路径

题目 一个机器人位于一个 m x n 网格的左上角 &#xff08;起始点在下图中标记为 “Start” &#xff09;。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角&#xff08;在下图中标记为 “Finish”&#xff09;。 问总共有多少条不同的路径&#xff1f; …

C#,字符串匹配(模式搜索)Sunday算法的源代码

Sunday算法是Daniel M.Sunday于1990年提出的一种字符串模式匹配算法。 核心思想&#xff1a;在匹配过程中&#xff0c;模式串并不被要求一定要按从左向右进行比较还是从右向左进行比较&#xff0c;它在发现不匹配时&#xff0c;算法能跳过尽可能多的字符以进行下一步的匹配&…

港科夜闻|香港科大团队研发多功能,可重构和抗破坏单线感测器阵列

关注并星标 每周阅读港科夜闻 建立新视野 开启新思维 1、香港科大团队研发多功能、可重构和抗破坏单线感测器阵列。研究人员开发出一种受人类听觉系统启发的感测器阵列设计技术。透过模仿人耳根据音位分布来区分声音的能力&#xff0c;这种新型感测器阵列方法可能优化感测器阵列…

Yolov8_使用自定义数据集训练模型1

前面几篇文章介绍了如何搭建Yolov8环境、使用默认的模型训练和推理图片及视频的效果、并使用GPU版本的torch加速推理、导出.engine格式的模型进一步利用GPU加速&#xff0c;本篇介绍如何自定义数据集&#xff0c;这样就可以训练出识别特定物体的模型。 《Yolov8_使用自定义数据…

innoDB存储引擎

1.逻辑存储结构 行数据->行->页->区->段->表空间 表空间(ibd文件)&#xff0c;一个mysql实例可以对应多个表空间&#xff0c;来存储记录&#xff0c;索引等数据。 段&#xff1a;分为数据段和索引段&#xff0c;回滚段&#xff0c;数据段就是B树的叶子节点&am…

HR3D+HRAuido+HRUI+HR3D_Plugins(游戏引擎源码)

国内知名游戏公司开发的游戏引擎&#xff0c;简洁高效&#xff0c;代码值得参考。包含了这几部分&#xff1a;HR3DHRAuidoHRUIHR3D_Plugins HR3DHRAuidoHRUIHR3D_Plugins&#xff08;游戏引擎源码&#xff09; 下载地址&#xff1a; 链接&#xff1a;https://pan.baidu.com/s/1…

使用Apache Spark处理Excel文件的简易指南

前言 在日常的工作中&#xff0c;表格内的工具是非常方便的x&#xff0c;但是当表格变得非常多的时候&#xff0c;就需要一些特定的处理。Excel作为功能强大的数据处理软件&#xff0c;广泛应用于各行各业&#xff0c;从企业管理到数据分析&#xff0c;可谓无处不在。然而&…

使用xbindkeys设置鼠标侧键

1.安装如下包 sudo apt install xbindkeys xautomation 2.生成配置文件 xbindkeys --defaults > $HOME/.xbindkeysrc 3.确定侧键键号 在终端执行下面的代码&#xff1a; xev | grep button 此时会出现如下窗口&#xff0c;将鼠标指针移动到这个窗口上&#xff1a; 单…

如何应对利用加密隧道发起的网络攻击?

日前&#xff0c;网络安全公司Zscaler的 ThreatLabz研究团队编写发布了《2023年加密攻击态势调查报告》&#xff0c;报告数据显示&#xff0c;目前85.9%的网络威胁是通过加密通道发起的&#xff0c;包括恶意软件、数据窃取和网络钓鱼攻击。更重要的是&#xff0c;许多加密攻击使…

【机器学习】调配师:咖啡的完美预测

有一天&#xff0c;小明带着一脸期待找到了你这位数据分析大师。他掏出手机&#xff0c;屏幕上展示着一份详尽的Excel表格。“看&#xff0c;这是我咖啡店过去一年的数据。”他滑动着屏幕&#xff0c;“每个月的销售量、广告投入&#xff0c;还有当月的气温&#xff0c;我都记录…

【MYSQL】事务隔离级别

脏读、幻读、不可重复读 脏读 一个事务正在对一条记录做修改&#xff0c;在这个事务完成并提交前&#xff0c;另一个事务也来读取同一条记录&#xff0c;读取了这些未提交的“脏”数据&#xff0c;并据此做进一步的处理&#xff0c;就会产生未提交的数据依赖关系。这种现象被形…

APP跳转系统相机拍照和拍摄

拍照和拍摄功能&#xff0c;我们项目用得不多。最近在做&#xff0c;记录哈。 都是调用的手机自带的。 具体代码如下&#xff0c;可以结合《vue<input>标签调用 Android的获取文件》一起理解哈&#xff1b; private static Uri imageUri; private static Uri VedioUri;…

User电脑中睡眠和休眠的区别,及对不同环境下模式设置建议

睡眠模式&#xff08;Sleep&#xff09;&#xff1a; 特点&#xff1a; 电脑进入睡眠模式时&#xff0c;系统的状态会保存在RAM中&#xff0c;电脑的大部分组件都会被关闭&#xff0c;但RAM仍然得到电源供应以保持数据。这使得电脑能够快速唤醒&#xff0c;因为数据保持在内存中…

【控制篇 / 分流】(7.4) ❀ 01. 对指定IP网段访问进行分流 ❀ FortiGate 防火墙

【简介】公司有两条宽带&#xff0c;一条ADSL拨号用来上网&#xff0c;一条移动SDWAN&#xff0c;已经连通总部内网服务器&#xff0c;领导要求&#xff0c;只有访问公司服务器IP时走移动SDWAN&#xff0c;其它访问都走ADSL拨号&#xff0c;如果你是管理员&#xff0c;你知道有…

自定义 React Hooks:编写高效、整洁和可重用代码的秘密武器

欢迎来到神奇的 React 世界 大家好!在 React 的世界中,有一个强大的秘密武器,它往往隐藏在显而易见的地方,由于缺乏理解或熟悉而没有得到充分利用。 这个强大的工具,被称为自定义 React hooks,可以彻底改变我们编写 React 应用程序代码的方式。通过提取组件中的有状态逻辑,自…

查找局域网树莓派raspberry的mac地址和ip

依赖python库&#xff1a; pip install socket pip install scapy运行代码&#xff1a; import socket from scapy.layers.l2 import ARP, Ether, srpdef get_hostname(ip_address):try:return socket.gethostbyaddr(ip_address)[0]except socket.herror:# 未能解析主机名ret…

Electron Apple SignIn 登录

本人写博客&#xff0c;向来主张&#xff1a;代码要完整&#xff0c;代码可运行&#xff0c;文中不留下任何疑惑。 最讨厌写博客&#xff0c;代码只留下片段&#xff0c;文中关键的东西没写清楚。之前看了那么多文章&#xff0c;就是不告诉我clientId从哪来的。 官方资料地址&…