当前位置: 首页 > news >正文

CSS——选择器、PxCook软件、盒子模型

选择器

结构伪类选择器

作用:根据元素的结构关系查找元素。

 

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>ul li:first-child{color: pink;}ul li:last-child{color: green;}ul li:nth-child(2n){color: blue;}</style>
</head>
<body><ul><li>我是第1个li</li><li>我是第2个li</li><li>我是第3个li</li><li>我是第4个li</li><li>我是第5个li</li><li>我是第6个li</li><li>我是第7个li</li><li>我是第8个li</li><li>我是第9个li</li><li>我是第10个li</li><li>我是第11个li</li></ul>
</body>
</html>

 

:nth-child(公式)

作用:根据元素的结构关系查找多个元素。

提示:公式中的n取值从 0 开始。

伪元素选择器

作用:创建虚拟元素(伪元素),用来摆放装饰性的内容。

注意点:

  • 必须设置 content: ””属性,用来 设置伪元素的内容,如果没有内容,则引号留空即可
  • 伪元素默认是行内显示模式
  • 权重标签选择器相同

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>/* 一个冒号是伪类 两个冒号是伪元素 */.box::before{content: "我";/* 因为是行内元素所以无法设置宽高 */display: inline-block;width: 30px;height: 30px;background-color: pink;}.box::after{content: "刘德华";}</style>
</head>
<body><div class="box">是</div>
</body>
</html>

 

PxCook

PxCook像素大厨) 是一款切图设计工具软件。支持PSD文件的文字、颜色、距离自动智能识别

  • 开发面板(自动智能识别)
  • 设计面板(手动测量尺寸和颜色)

创建项目 → 输入 项目名称、项目类型 Web → 单击按钮创建项目 → 单击按钮添加,导入设计稿

盒子模型

盒子模型 – 组成

作用:布局网页,摆放盒子和内容。

盒子模型重要组成部分:

  • 内容区域 – width & height
  • 内边距 – padding(出现在内容与盒子边缘之间)
  • 边框线 – border
  • 外边距 – margin(出现在盒子外面)

盒子模型 – 边框线

属性名:borderbd

属性值:边框线粗细  线条样式  颜色区分顺序)

常用线条样式

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>.box{width: 200px;height: 200px;background-color: pink;/* border: solid 3px blue; *//* solid 实线 dashed 虚线 dotted 点线 */border: 3px dotted red;}input{width: 490px;height: 30px;border: 2px solid red;font-size: 14px;}</style>
</head>
<body><div class="box"></div><br><input type="text" placeholder="平板">
</body>
</html>

设置单方向边框线

属性名:border-方位名词bd+方位名词首字母,例如,bdl

属性值:边框线粗细  线条样式  颜色(区分顺序)

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>.box{width: 200px;height: 200px;background-color: pink;/* border: solid 3px blue; *//* solid 实线 dashed 虚线 dotted 点线 */border: 3px dotted blue;border-top: 3px dotted red;}input{width: 490px;height: 30px;border: 2px solid red;font-size: 14px;}</style>
</head>
<body><div class="box"></div><br><input type="text" placeholder="平板">
</body>
</html>

 

盒子模型 – 内边距

作用:设置 内容 盒子边缘 之间的距离。

属性名:padding / padding-方位名词

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>.box{width: 200px;height: 200px;background-color: pink;padding: 30px;/* 内边距 padding: 30px 表示上下左右都是30px */}input{width: 490px;height: 30px;border: 2px red solid;font-size: 14px;/* 可以设置单方向 */padding-left: 15px;}</style>
</head>
<body><div class="box">文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字</div><input type="text" placeholder="平板">
</body>
</html>

盒子模型 – 内边距 – 多值写法

padding 多值写法

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>.box{width: 200px;height: 200px;background-color: pink;/* 一个值 上下左右 *//* padding: 10px; *//* 两个值 上下10 左右30 *//* padding: 10px 30px; *//* 三个值 上10 左右30 下50 *//* padding: 10px 30px 50px; *//* 四个值 顺时针 上下左右 */padding: 10px 30px 50px 40px;}</style>
</head>
<body><div class="box">文字</div>
</body>
</html>

 

技巧:从上开始顺时针赋值,当前方向没有数值则与对面取值相同。

盒子模型 – 尺寸计算

默认情况

盒子尺寸 = 内容尺寸 + border 尺寸 + 内边距尺寸

结论:给盒子加 border / padding 撑大盒子

解决

  • 手动做减法,减掉 border / padding 的尺寸
  • 內减模式:box-sizing: border-box
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>.box{/*1. 手动去减 *//* width 160px *//* height 160px  *//* 2.css盒子模型 box-sizing: border-box*/width: 200px;height: 200px;background-color: pink;border: 10px solid red;padding: 10px;box-sizing: border-box;}</style>
</head>
<body><div class="box">qwe</div>
</body>
</html>

 

盒子模型 – 外边距

作用:拉开两个盒子之间的距离

属性名:margin

提示:与 padding 属性值写法、含义相同

技巧:版心居中 – 左右 margin 值 为 auto(盒子要有宽度)

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>.box{width: 800px;height: 1000px;background-color: pink;/* 有宽度的块级元素水平居中 */margin:auto;}</style>
</head>
<body><div class="box"></div>
</body>
</html>

清除默认样式

清除标签默认的样式,比如:默认的内外边距。

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>* {/* 清除内外边距 */margin: 0;padding: 0;box-sizing: border-box;}ul {margin: 100px;}li {/* 取消li的小圆点 */list-style: none;}</style>
</head><body><h1>标题</h1><ul><li>123</li><li>123</li></ul>
</body></html>

盒子模型 – 元素溢出

作用:控制溢出元素的内容显示方式

属性名:overflow

属性值

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>.box {/* 超出的部分,隐藏 */overflow: hidden;/* 超出的部分显示滚动条 *//* overflow: scroll; *//* auto 如果超出,则显示滚动条,不超出则不显示滚动条 *//* overflow: auto; */width: 200px;height: 200px;background-color: pink;}</style>
</head><body><div class="box">我要写很多很多很多的文字我要写很多很多很多的文字我要写很多很多很多的文字我要写很多很多很多的文字我要写很多很多很多的文字我要写很多很多很多的文字我要写很多很多很多的文字我要写很多很多很多的文字我要写很多很多很多的文字我要写很多很多很多的文字我要写很多很多很多的文字我要写很多很多很多的文字</div>
</body></html>

外边距问题 – 合并现象

场景:垂直排列的兄弟元素,上下 margin 会合并

现象:取两个 margin 中的较大值生效

​​​​​​​

外边距问题 – 塌陷问题

场景:父子级的标签,子级的添加 上外边距 会产生塌陷问题

现象:导致父级一起向下移动

解决方法:

  • 取消子级margin级设置padding
  • 级设置 overflow: hidden
  • 级设置 border-top
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>/* .nav ul li a {} */.box1,.box2 {width: 100px;height: 100px;background-color: pink;}.box1 {margin-bottom: 100px;}.box2 {background-color: purple;margin-top: 150px;}/* 结果是 100px, 外边距合并以较大外边距为准 */.father {/* 防止外边距塌陷 *//* 1. 方案1  overflow: hidden; *//* 2. 方案2  border-top: 1px solid red; *//* transparent 颜色透明 */border-top: 1px solid transparent;width: 200px;height: 200px;background: pink;/* 3. 方案3  padding-top: 20px; */}.son {width: 100px;height: 100px;background-color: skyblue;margin-top: 20px;}</style>
</head><body><div class="box1">上</div><div class="box2">下</div><div class="father"><div class="son"></div></div>
</body></html>

行内元素 – 内外边距问题

场景:行内元素添加 margin 和 padding,无法改变元素垂直位置

解决方法:给行内元素添加 line-height 可以改变垂直位置

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>span {/* 上下不生效 有问题 给行高可以解决  转换为其他元素  */padding: 30px;line-height: 60px;}</style>
</head><body><span>我是span</span>
</body></html>

盒子模型 – 圆角

作用:设置元素的外边框为圆角。

属性名:border-radius

属性值:数字+px / 百分比

提示:属性值是圆角半径

技巧:从左上角开始顺时针赋值,当前角没有数值则与对角取值相同。​​​​​​​

常见应用 – 正圆形状

正方形盒子设置圆角属性值为 宽高的一半 / 50%

常见应用 – 胶囊形状

长方形盒子设置圆角属性值为 盒子高度的一半

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>.box {width: 100px;height: 100px;background-color: pink;/* 圆角边框 */border-radius: 15px;}/* img {border-radius: 50%;} */.box2 {width: 200px;height: 40px;background-color: pink;border-radius: 20px;}.img1 {border-radius: 15px;}.img2 {border: 2px solid red;border-radius: 0 50%;}.img4 {border-radius: 15px 50px 80px 100px;}</style>
</head><body><div class="box"></div><img src="./images/1.png" alt=""><div class="box2"></div><img src="./images/1.png" alt="" class="img1"><img src="./images/1.png" alt="" class="img2"><img src="./images/1.png" alt="" class="img3"><img src="./images/1.png" alt="" class="img4"></body></html>

盒子模型 – 阴影(拓展)

作用:给元素设置阴影效果

属性名:box-shadow

属性值:X 轴偏移量  Y 轴偏移量  模糊半径  扩散半径  颜色  内外阴影

注意:

  • X 轴偏移量 和 Y 轴偏移量 必须书写
  • 默认是外阴影,内阴影需要添加 inset

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>img {border-radius: 50%;/* 盒子阴影 *//* box-shadow: 3px 5px 4px rgba(0, 0, 0, .4); */}img:hover {box-shadow: 0 15px 30px rgba(0, 0, 0, .3);}</style>
</head><body><img src="./images/1.png" alt="">
</body></html>

综合案例1——抖音直播

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>/* 清除样式 */* {margin: 0;padding: 0;box-sizing: border-box;}body {background-color: #f1f1f1;}.card {width: 270px;height: 255px;background-color: #fff;border-radius: 15px;/* 让块级盒子水平居中 左右margin是auto就可以了 */margin: 100px auto 0;/* 让里面的文字和图片水平居中 */text-align: center;padding-top: 40px;}.card h4 {/* 不加粗 */font-weight: 400;/* 上 15 下 10  左右不要 */margin: 15px 0 10px 0;}.card p {font-size: 14px;}.card:hover {box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);}</style>
</head><body><div class="card"><img src="./images/liveSDK.svg" alt=""><h4>抖音直播SDK</h4><p>包含抖音直播看播功能</p></div></body></html>

综合案例2——新闻

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>* {margin: 0;padding: 0;box-sizing: border-box;}li {/* 取消小点 */list-style: none;}.box {width: 360px;height: 190px;/* background-color: pink; *//* 块级盒子水平居中 */margin: 100px auto;}.box-hd {height: 34px;background-color: #eeeeee;border: 1px solid #dbdee1;border-left: 0;}.box-hd a {/* 转换为块级元素 */display: block;width: 50px;height: 34px;background-color: #fff;text-align: center;line-height: 31px;font-size: 14px;color: #333;text-decoration: none;border-top: 3px solid #ff8400;border-right: 1px solid #dbdee1;/* margin是负值,则盒子往上走 */margin-top: -1px;}.box-bd {margin-top: 3px;}.box-bd li {line-height: 26px;background: url(./images/square.png) no-repeat left center;padding-left: 15px;}.box-bd li a {font-size: 14px;text-decoration: none;color: #333;background: url(./images/img.gif) no-repeat left center;padding-left: 20px;}.box-bd li a:hover {color: #ff8400;text-decoration: underline;}</style>
</head><body><div class="box"><!-- 头部 hd  是 head的缩写 --><div class="box-hd"><a href="#">新闻</a></div><!-- 身体部分  bd 是 body的缩写--><ul class="box-bd"><li><a href="#">新农村人,温暖的身手</a></li><li><a href="#">新农村人,温暖的身手</a></li><li><a href="#">新农村人,温暖的身手</a></li><li><a href="#">新农村人,温暖的身手</a></li><li><a href="#">新农村人,温暖的身手</a></li><li><a href="#">新农村人,温暖的身手</a></li></ul></div>
</body></html>

相关文章:

CSS——选择器、PxCook软件、盒子模型

选择器 结构伪类选择器 作用&#xff1a;根据元素的结构关系查找元素。 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0&quo…...

Mysql 大表limit查询优化原理实战

文章目录 1 大表查询无条件优化&原理(入门)2 大表查询带 条件 优化&原理(进阶)2.1 where 后面的查询字段只有一个时&#xff0c;要求该字段是索引字段2.2 where 后面的查询字段有多个时&#xff0c;尽量让查询字段为索引字段且字段值基数大 3 大表查询带 排序 优化&…...

在vscode中开发运行uni-app项目

确保电脑已经安装配置好了node、vue等相关环境依赖 进行项目的创建 vue create -p dcloudio/uni-preset-vue 项目名 vue create -p dcloudio/uni-preset-vue uni-app 选择模版 这里选择【默认模版】 项目创建成功后在vscode中打开 第一次打开项目 pages.json 文件会报错&a…...

【JavaEE初阶 — 多线程】Thread的常见构造方法&属性

目录 Thread类的属性 1.Thread 的常见构造方法 2.Thread 的几个常见属性 2.1 前台线程与后台线程 2.2 setDaemon() 2.3 isAlive() Thread类的属性 Thread 类是JVM 用来管理线程的一个类&#xff0c;换句话说&#xff0c;每个线程都有一个唯一的Thread 对象与之关联&am…...

ctfshow(316)--XSS漏洞--反射性XSS

Web316 进入界面&#xff1a; 审计 显示是关于反射性XSS的题目。 思路 首先想到利用XSS平台解题&#xff0c;看其他师傅的wp提示flag是在cookie中。 当前页面的cookie是flagyou%20are%20not%20admin%20no%20flag。 但是这里我使用XSS平台&#xff0c;显示的cookie还是这样…...

ubuntu22.04安装conda

在 Ubuntu 22.04 上安装 Conda 可以通过以下步骤进行&#xff1a; 下载 Miniconda&#xff08;轻量级版本的 Conda&#xff09;&#xff1a; 打开终端并运行以下命令以下载 Miniconda 安装脚本&#xff1a; wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-…...

D58【python 接口自动化学习】- python基础之异常

day58 异常捕获 学习日期&#xff1a;20241104 学习目标&#xff1a;异常 -- 74 自定义异常捕获&#xff1a;如何定义业务异常&#xff1f; 学习笔记&#xff1a; 自定义异常的用途 自定义异常的方法 # 抛出一个异常 # raise ValueError(value is error) # ValueError: val…...

Java项目实战II基于Spring Boot的便利店信息管理系统(开发文档+数据库+源码)

目录 一、前言 二、技术介绍 三、系统实现 四、文档参考 五、核心代码 六、源码获取 全栈码农以及毕业设计实战开发&#xff0c;CSDN平台Java领域新星创作者&#xff0c;专注于大学生项目实战开发、讲解和毕业答疑辅导。获取源码联系方式请查看文末 一、前言 在快节奏的…...

Java-日期计算工具类DateCalculator

DateCalculator是用于日期计算的工具类。这个工具类将包括日期的加减、比较、周期计算、日期 范围生成等功能。 import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.Period; import java.time.temporal.ChronoUnit;…...

单片机串口接收状态机STM32

单片机串口接收状态机stm32 前言 项目的芯片stm32转国产&#xff0c;国产芯片的串口DMA接收功能测试不通过&#xff0c;所以要由原本很容易配置的串口空闲中断触发DMA接收数据的方式转为串口逐字节接收的状态机接收数据 两种方式各有优劣&#xff0c;不过我的芯片已经主频跑…...

ipv6的 fc00(FC00::/7) 和 fec0(FEC0::/10)

ipv6的 fc00(FC00::/7)&#xff08;唯一本地地址&#xff09; 替代了 fec0(FEC0::/10) &#xff08;站点本地地址&#xff0c;已弃用&#xff09; ipv6的 fc00(FC00::/7) 替代了 fec0(FEC0::/10) , 在IPv6地址中&#xff0c;FC00::/7&#xff08;通常简写为FC00&#xff09;和…...

Chat GPT英文学术写作指令

目录 Chat GPT英文学术写作指令 Chat GPT英文学术写作指令 1."为我捉供一些建议和技巧,以提高我的学术写作质最和风格" (Provide me with some suggestions andtips to improve the quality andstyleofmyacademic writing.) 2."帮我提写一个清晰而有逻辑的…...

超详细Pycharm安装汉化教程,Python环境配置和使用指南,Python零基础入门看这个就够了!

包含编程资料、学习路线图、源代码、软件安装包等&#xff01;【[点击这里]】&#xff01; PyCharm 是由 JetBrains 打造的一款 Python IDE &#xff08;集成开发环境&#xff0c;Integrated Development Environment&#xff09;&#xff0c;带有一整套可以帮助用户在使用 Py…...

react-native:解决使用webView后部分场景在安卓10崩溃闪退问题

app闪退问题原因&#xff1a; 安卓7以上版本&#xff08;7和7以下版本不会出现闪退&#xff09;&#xff1a;在屏幕不可视区域加载webView或者webView不在可视区域内切换页面时app崩溃闪退&#xff08;在屏幕可视区域加载webView或者webView在可视区域内切换页面不会闪退&…...

大数据工具 flume 的安装配置与使用 (详细版)

参考网址&#xff1a;Flume 1.9用户手册中文版 — 可能是目前翻译最完整的版本了 1&#xff0c;上传安装包 安装包链接&#xff1a;文件下载-奶牛快传 Download &#xff5c;CowTransfer 口令&#xff1a;x8bhcg 1&#xff0c;切换盘符到安装目录 cd /opt/moudles 解压文件…...

智慧城市智慧城市项目方案-大数据平台建设技术方案(原件Word)

第1章 总体说明 1.1 建设背景 1.2 建设目标 1.3 项目建设主要内容 1.4 设计原则 第2章 对项目的理解 2.1 现状分析 2.2 业务需求分析 2.3 功能需求分析 第3章 大数据平台建设方案 3.1 大数据平台总体设计 3.2 大数据平台功能设计 3.3 平台应用 第4章 政策标准保障…...

C语言比较两个字符串是否相同

在不使用string.h中的内置函数的情况下 #include <stdio.h> #include <string.h> void main(){char arr1[]"hello world";char arr2[]"hello world";int i,a0;if(strlen(arr1)!strlen(arr2)){print("不相等");return 0;}for(i0;arr…...

丹摩征文活动|FLUX.1图像生成模型:AI工程师的创新实践

文章目录 一、对"FLUX.1"系列模型版本分析 二、AI工程师与FLUX.1系列模型 三、ComfyUI在线部署四、FLUX.1在线部署五、添加工作流呈现效果图展示六、总结 黑森林实验室&#xff08;Black Forest Labs&#xff09;推出的FLUX.1图像生成模型&#xff0c;凭借120亿参数的…...

ZABBIX API获取监控服务器OS层信息

Zabbix 是一款强大的开源监控解决方案,能够通过其 API 接口自动化管理和获取监控数据。在这篇文章中,详细讲解如何通过 Zabbix API 批量获取服务器的系统名称、IP 地址及操作系统版本信息,并将数据保存到 CSV 文件中。本文适合对 Python 编程和 Zabbix 监控系统有一定基础的…...

SpringBoot基础系列学习(五):JdbcTemplate 访问数据库

文章目录 一丶介绍二丶引入依赖三丶配置配置文件四丶创建表五丶java代码 一丶介绍 Spring Boot作为Spring的集大成者&#xff0c;自然会将JdbcTemplate集成进去。Spring Boot针对JDBC的使用提供了对应的Starter包&#xff1a;spring-boot-starter-jdbc&#xff0c;它其实就是在…...

JavaEE-多线程初阶(3)

目录 1.线程的状态 1.1 NEW、RUNNABLE、TERMINATED 1.2 TIMED_WAITING 1.3 WAITING 1.4 BLOCKED 2.多线程带来的风险-线程安全&#xff08;重点&#xff09; 2.1 观察线程不安全的现象 2.2 分析产生该现象的原因 2.3 产生线程安全问题的原因 2.3.1 抢占式执行&#x…...

从入门到精通:如何在Vue项目中有效运用el-image-viewer

Element UI之el-image-viewer组件详解 引言 在现代 Web 应用中,高质量的用户体验是不可或缺的一环。Element UI 作为一款基于Vue.js 2.0 的桌面端组件库,以其丰富的组件集、良好的文档和支持赢得了广大开发者的好评。本文将深入探讨el-image-viewer组件,这是一个用于在网页…...

uniapp组件实现省市区三级联动选择

1.导入插件 先将uni-data-picker组件导入我们的HBuilder项目中&#xff0c;在DCloud插件市场搜索uni-data-picker 点击下载插件并导入到我们的项目中 2.组件调用 curLocation &#xff1a;获取到的当前位置&#xff08;省市区&#xff09; <uni-data-picker v-slot:defa…...

【C++】异常处理机制(对运行时错误的处理)

&#x1f308; 个人主页&#xff1a;谁在夜里看海. &#x1f525; 个人专栏&#xff1a;《C系列》《Linux系列》 ⛰️ 天高地阔&#xff0c;欲往观之。 目录 引言 1.编译器可以处理的错误 2.编译器不能处理的错误 3.传统的错误处理机制 assert终止程序 返回错误码 一、…...

C++ boost steady_timer使用介绍

文章目录 1. 引入必要的头文件2. 基本用法2.1 同步定时器解释:2.2 异步定时器解释:3. 异步定时器与回调函数4. 设置定时器的超时时间4.1 使用秒、毫秒、微秒4.2 修改定时器的到期时间5. 多次使用定时器6. 循环执行任务7. 错误处理总结:C++ Boost 库提供了 boost::asio::stea…...

JVM 由多个模块组成,每个模块负责特定的功能

Java虚拟机&#xff08;JVM, Java Virtual Machine&#xff09;是一个抽象的计算机&#xff0c;它提供了一个运行环境&#xff0c;使得Java字节码可以在不同的平台上执行。JVM 由多个模块组成&#xff0c;每个模块负责特定的功能。以下是 JVM 的主要模块及其功能&#xff1a; …...

ORACLE批量插入更新如何拆分大事务?

拆分大事务 一、批量插入更新二、拆分事务之前文章MYSQL批量插入更新如何拆分大事务?说明了Mysql如何拆分,本篇文章探讨Oracle或OceanBase批量插入更新拆分大事务的问题 一、批量插入更新 oracle批量插入更新可使用merge语法eg: merge test ausing test_tmp bon (a.id = b.id…...

kafka+zookeeper的搭建

kafka从2.8版本开始&#xff0c;就可以不用配置zookeeper了&#xff0c;但是也可以继续配置。我目前使用的kafka版本是kafka_2.12-3.0.0.tgz&#xff0c;其中前面的2.12表示是使用该版本的scala语言进行编写的&#xff0c;而后面的3.00才是kafka当前的版本。 通过百度网盘分享…...

Spark中的宽窄依赖

一、什么是依赖关系 这里通过一张图来解释&#xff1a; result_rdd是由tuple_rdd使用reduceByKey算子得到的&#xff0c; 而tuple_rdd是由word_rdd使用map算子得到的&#xff0c;word_rdd又是由input_rdd使用flatMap算子得到的。它们之间的关系就称为依赖关系&#xff01; 二…...

安装和运行开发微信小程序

下载HBuilder uniapp官网 uni-app官网 微信开发者工具 安装 微信小程序 微信小程序 官网 微信小程序 配置 运行 注意&#xff1a;运行前需要开启服务端口 如果运行看不到效果&#xff0c;设置下基础库选别的版本 配置...