Bootstrap 5 Flex 布局语法知识点及案例

Bootstrap 5 提供了强大的 Flexbox 工具集,让布局变得更加简单灵活。以下是 Bootstrap 5 Flex 布局的完整知识点和详细案例代码。

一、Flex 布局基础语法

1. 启用 Flex 布局

<div class="d-flex">我是一个flex容器</div>
<div class="d-inline-flex">我是一个行内flex容器</div>

2. 方向控制 (flex-direction)

<div class="d-flex flex-row">水平排列(默认)</div>
<div class="d-flex flex-row-reverse">水平反向排列</div>
<div class="d-flex flex-column">垂直排列</div>
<div class="d-flex flex-column-reverse">垂直反向排列</div>

3. 主轴对齐 (justify-content)

<div class="d-flex justify-content-start">起始对齐(默认)</div>
<div class="d-flex justify-content-end">末端对齐</div>
<div class="d-flex justify-content-center">居中对齐</div>
<div class="d-flex justify-content-between">两端对齐</div>
<div class="d-flex justify-content-around">均匀分布</div>
<div class="d-flex justify-content-evenly">完全均匀分布</div>

4. 交叉轴对齐 (align-items)

<div class="d-flex align-items-start">顶部对齐</div>
<div class="d-flex align-items-end">底部对齐</div>
<div class="d-flex align-items-center">垂直居中</div>
<div class="d-flex align-items-baseline">基线对齐</div>
<div class="d-flex align-items-stretch">拉伸填充(默认)</div>

5. 多行对齐 (align-content)

<div class="d-flex flex-wrap align-content-start">多行顶部对齐</div>
<div class="d-flex flex-wrap align-content-end">多行底部对齐</div>
<div class="d-flex flex-wrap align-content-center">多行居中</div>
<div class="d-flex flex-wrap align-content-between">多行两端对齐</div>
<div class="d-flex flex-wrap align-content-around">多行均匀分布</div>
<div class="d-flex flex-wrap align-content-stretch">多行拉伸(默认)</div>

6. 子项对齐 (align-self)

<div class="d-flex"><div class="align-self-start">顶部对齐</div><div class="align-self-end">底部对齐</div><div class="align-self-center">垂直居中</div><div class="align-self-baseline">基线对齐</div><div class="align-self-stretch">拉伸填充</div>
</div>

7. 填充与间距 (flex-fill & gap)

<div class="d-flex"><div class="flex-fill">填充剩余空间</div><div class="flex-fill">填充剩余空间</div>
</div><div class="d-flex gap-1">小间距</div>
<div class="d-flex gap-2">中等间距</div>
<div class="d-flex gap-3">大间距</div>

8. 换行控制 (flex-wrap)

<div class="d-flex flex-nowrap">不换行(默认)</div>
<div class="d-flex flex-wrap">换行</div>
<div class="d-flex flex-wrap-reverse">反向换行</div>

9. 子项排序 (order)

<div class="d-flex"><div class="order-3">第一项</div><div class="order-1">第二项</div><div class="order-2">第三项</div>
</div>

10. 子项扩展 (flex-grow/shrink)

<div class="d-flex"><div class="flex-grow-1">扩展填充</div><div>固定宽度</div>
</div><div class="d-flex"><div class="flex-shrink-1">允许收缩</div><div class="w-100">宽元素</div>
</div>

二、响应式 Flex 布局

所有 Flex 类都可以添加响应式前缀:

  • .d-sm-flex
  • .flex-md-row
  • .justify-content-lg-center
  • .align-items-xl-start

断点:sm (≥576px), md (≥768px), lg (≥992px), xl (≥1200px), xxl (≥1400px)

三、完整案例代码

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Bootstrap 5 Flex 布局案例</title><!-- Bootstrap 5 CSS --><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"><style>.box {height: 50px;background-color: #0d6efd;color: white;border: 1px solid white;display: flex;align-items: center;justify-content: center;}.box-alt {background-color: #6c757d;}.container-example {background-color: #f8f9fa;padding: 15px;margin-bottom: 20px;border-radius: 5px;}h2 {margin-top: 30px;margin-bottom: 15px;}</style>
</head>
<body><div class="container py-4"><h1 class="text-center mb-4">Bootstrap 5 Flex 布局案例</h1><!-- 1. 基本 Flex 容器 --><div class="container-example"><h2>1. 基本 Flex 容器</h2><div class="d-flex p-2 bg-light"><div class="box">Flex 容器</div><div class="box">子项 1</div><div class="box">子项 2</div></div><div class="d-inline-flex p-2 bg-light mt-2"><div class="box">行内 Flex 容器</div></div></div><!-- 2. 方向控制 --><div class="container-example"><h2>2. 方向控制</h2><div class="d-flex flex-row mb-2"><div class="box">flex-row (默认)</div><div class="box">子项 1</div><div class="box">子项 2</div></div><div class="d-flex flex-row-reverse mb-2"><div class="box">flex-row-reverse</div><div class="box">子项 1</div><div class="box">子项 2</div></div><div class="d-flex flex-column mb-2" style="height: 150px;"><div class="box">flex-column</div><div class="box">子项 1</div><div class="box">子项 2</div></div><div class="d-flex flex-column-reverse" style="height: 150px;"><div class="box">flex-column-reverse</div><div class="box">子项 1</div><div class="box">子项 2</div></div></div><!-- 3. 主轴对齐 --><div class="container-example"><h2>3. 主轴对齐 (justify-content)</h2><div class="d-flex justify-content-start mb-2"><div class="box">start (默认)</div><div class="box">子项</div></div><div class="d-flex justify-content-end mb-2"><div class="box">end</div><div class="box">子项</div></div><div class="d-flex justify-content-center mb-2"><div class="box">center</div><div class="box">子项</div></div><div class="d-flex justify-content-between mb-2"><div class="box">between</div><div class="box">子项</div><div class="box">子项</div></div><div class="d-flex justify-content-around mb-2"><div class="box">around</div><div class="box">子项</div><div class="box">子项</div></div><div class="d-flex justify-content-evenly"><div class="box">evenly</div><div class="box">子项</div><div class="box">子项</div></div></div><!-- 4. 交叉轴对齐 --><div class="container-example"><h2>4. 交叉轴对齐 (align-items)</h2><div class="d-flex align-items-start mb-2 bg-light" style="height: 100px;"><div class="box">align-items-start</div><div class="box">子项</div></div><div class="d-flex align-items-end mb-2 bg-light" style="height: 100px;"><div class="box">align-items-end</div><div class="box">子项</div></div><div class="d-flex align-items-center mb-2 bg-light" style="height: 100px;"><div class="box">align-items-center</div><div class="box">子项</div></div><div class="d-flex align-items-baseline mb-2 bg-light" style="height: 100px;"><div class="box" style="height: 60px;">align-items-baseline</div><div class="box">子项</div></div><div class="d-flex align-items-stretch bg-light" style="height: 100px;"><div class="box" style="height: auto;">align-items-stretch (默认)</div><div class="box" style="height: auto;">子项</div></div></div><!-- 5. 子项单独对齐 --><div class="container-example"><h2>5. 子项单独对齐 (align-self)</h2><div class="d-flex bg-light" style="height: 150px;"><div class="align-self-start box">align-self-start</div><div class="align-self-end box">align-self-end</div><div class="align-self-center box">align-self-center</div><div class="align-self-baseline box" style="height: 70px;">align-self-baseline</div><div class="align-self-stretch box" style="height: auto;">align-self-stretch</div></div></div><!-- 6. 填充与间距 --><div class="container-example"><h2>6. 填充与间距</h2><h5 class="mt-3">flex-fill</h5><div class="d-flex mb-3"><div class="flex-fill box">flex-fill</div><div class="flex-fill box">flex-fill</div><div class="flex-fill box">flex-fill</div></div><h5>间距 (gap)</h5><div class="d-flex gap-1 mb-2"><div class="box">gap-1</div><div class="box">子项</div><div class="box">子项</div></div><div class="d-flex gap-2 mb-2"><div class="box">gap-2</div><div class="box">子项</div><div class="box">子项</div></div><div class="d-flex gap-3"><div class="box">gap-3</div><div class="box">子项</div><div class="box">子项</div></div></div><!-- 7. 换行控制 --><div class="container-example"><h2>7. 换行控制 (flex-wrap)</h2><h5 class="mt-3">flex-nowrap (默认)</h5><div class="d-flex flex-nowrap mb-3" style="width: 300px; overflow: auto;"><div class="box" style="width: 150px;">flex-nowrap</div><div class="box" style="width: 150px;">子项</div><div class="box" style="width: 150px;">子项</div></div><h5>flex-wrap</h5><div class="d-flex flex-wrap mb-3" style="width: 300px;"><div class="box" style="width: 150px;">flex-wrap</div><div class="box" style="width: 150px;">子项</div><div class="box" style="width: 150px;">子项</div></div><h5>flex-wrap-reverse</h5><div class="d-flex flex-wrap-reverse" style="width: 300px;"><div class="box" style="width: 150px;">flex-wrap-reverse</div><div class="box" style="width: 150px;">子项</div><div class="box" style="width: 150px;">子项</div></div></div><!-- 8. 多行对齐 --><div class="container-example"><h2>8. 多行对齐 (align-content)</h2><div class="d-flex flex-wrap align-content-start mb-2 bg-light" style="height: 200px;"><div class="box" style="width: 100%; height: 40px;">align-content-start</div><div class="box" style="width: 30%;">子项</div><div class="box" style="width: 30%;">子项</div><div class="box" style="width: 30%;">子项</div></div><div class="d-flex flex-wrap align-content-between bg-light" style="height: 200px;"><div class="box" style="width: 100%; height: 40px;">align-content-between</div><div class="box" style="width: 30%;">子项</div><div class="box" style="width: 30%;">子项</div><div class="box" style="width: 30%;">子项</div></div></div><!-- 9. 响应式 Flex --><div class="container-example"><h2>9. 响应式 Flex</h2><div class="d-flex flex-column flex-md-row"><div class="box">小屏幕垂直</div><div class="box">中等屏幕水平</div></div></div></div><!-- Bootstrap 5 JS Bundle with Popper --><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

四、Flex 布局案例代码

以下是一个综合性的示例,展示了如何使用 Bootstrap 5 的 Flex 工具类创建复杂的布局。每个部分都有详细注释,帮助理解每个类的用途。

示例:响应式导航栏与内容布局

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><title>Bootstrap 5 Flex 布局示例</title><!-- 引入 Bootstrap CSS --><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"><style>/* 自定义样式,可根据需要调整 */.header {background-color: #0d6efd;color: white;padding: 1rem;}.sidebar {background-color: #f8f9fa;padding: 1rem;}.main-content {padding: 1rem;}.footer {background-color: #dee2e6;padding: 1rem;text-align: center;}</style>
</head>
<body><!-- 头部导航栏 --><div class="header d-flex justify-content-between align-items-center"><div><h1 class="mb-0">网站标题</h1></div><div><nav class="navbar navbar-expand-md"><div class="container-fluid"><!-- 切换按钮(移动设备) --><button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="切换导航"><span class="navbar-toggler-icon"></span></button><!-- 导航链接 --><div class="collapse navbar-collapse" id="navbarNav"><ul class="navbar-nav ms-auto"><li class="nav-item"><a class="nav-link active" aria-current="page" href="#">首页</a></li><li class="nav-item"><a class="nav-link" href="#">关于</a></li><li class="nav-item"><a class="nav-link" href="#">服务</a></li><li class="nav-item"><a class="nav-link" href="#">联系</a></li></ul></div></div></nav></div></div><!-- 主内容区域 --><div class="container-fluid"><div class="row"><!-- 侧边栏 --><nav class="col-md-3 col-lg-2 d-none d-md-block sidebar"><div class="position-sticky"><ul class="nav flex-column"><li class="nav-item"><a class="nav-link active" href="#">侧边栏1</a></li><li class="nav-item"><a class="nav-link" href="#">侧边栏2</a></li><li class="nav-item"><a class="nav-link" href="#">侧边栏3</a></li><li class="nav-item"><a class="nav-link" href="#">侧边栏4</a></li></ul></div></nav><!-- 主要内容 --><main class="col-md-9 ms-sm-auto col-lg-10 px-md-4"><div class="d-flex flex-column"><h2>主要内容区域</h2><p>这是一个使用 Bootstrap 5 Flex 布局的示例。</p><div class="d-flex flex-wrap justify-content-between align-items-center"><div class="p-2 border border-1 border-secondary m-2">项目1</div><div class="p-2 border border-1 border-secondary m-2">项目2</div><div class="p-2 border border-1 border-secondary m-2">项目3</div><div class="p-2 border border-1 border-secondary m-2">项目4</div><div class="p-2 border border-1 border-secondary m-2">项目5</div></div><p>上述项目使用了 Flex 换行和间距工具类,实现了响应式布局。</p></div></main></div></div><!-- 页脚 --><div class="footer"><p>© 2025 公司名称. 版权所有.</p></div><!-- 引入 Bootstrap JS 和依赖的 Popper.js --><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

代码解析

  1. 引入 Bootstrap CSS 和 JS

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    ...
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    

    通过 CDN 引入 Bootstrap 5 的 CSS 和 JS 文件,确保可以使用 Bootstrap 的所有功能。

  2. 头部导航栏

    <div class="header d-flex justify-content-between align-items-center">...
    </div>
    
    • .header:自定义类,用于设置头部背景色和文字颜色。
    • .d-flex:将容器设置为 Flex 容器。
    • .justify-content-between:在主轴(水平方向)上两端对齐。
    • .align-items-center:在交叉轴(垂直方向)上居中对齐。

    导航栏部分

    <nav class="navbar navbar-expand-md">...
    </nav>
    

    使用 Bootstrap 的导航栏组件,实现响应式导航。

  3. 主内容区域

    <div class="container-fluid"><div class="row">...</div>
    </div>
    
    • .container-fluid:创建一个全宽的容器。
    • .row:创建一个行,用于包含列。

    侧边栏

    <nav class="col-md-3 col-lg-2 d-none d-md-block sidebar">...
    </nav>
    
    • .col-md-3 col-lg-2:在不同屏幕尺寸下设置侧边栏的宽度。
    • .d-none d-md-block:在中等及以上屏幕尺寸下显示侧边栏,其他情况下隐藏。
    • .sidebar:自定义类,用于设置侧边栏的背景色和内边距。

    主要内容

    <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">...
    </main>
    
    • .col-md-9 ms-sm-auto col-lg-10:在不同屏幕尺寸下设置主内容区域的宽度。
    • .px-md-4:在中等及以上屏幕尺寸下设置主内容区域的内边距。

    Flex 布局示例

    <div class="d-flex flex-wrap justify-content-between align-items-center">...
    </div>
    
    • .d-flex:将容器设置为 Flex 容器。
    • .flex-wrap:允许子元素换行。
    • .justify-content-between:在主轴(水平方向)上两端对齐。
    • .align-items-center:在交叉轴(垂直方向)上居中对齐。

    Flex 项目

    <div class="p-2 border border-1 border-secondary m-2">项目1</div>
    
    • .p-2:设置内边距。
    • .border border-1 border-secondary:添加边框。
    • .m-2:设置外边距。
  4. 页脚

    <div class="footer">...
    </div>
    

    使用自定义类 .footer 设置页脚的背景色和文字对齐。


五、Flex 布局的更多示例

示例 1:垂直居中内容

<div class="d-flex align-items-center justify-content-center" style="height: 200px; background-color: #e9ecef;"><div><h3>垂直居中内容</h3><p>使用 Flex 布局实现垂直和水平居中。</p></div>
</div>

解析

  • .d-flex:设置为 Flex 容器。
  • .align-items-center:在交叉轴(垂直方向)上居中对齐。
  • .justify-content-center:在主轴(水平方向)上居中对齐。
  • style="height: 200px; background-color: #e9ecef;":设置容器高度和背景色。

示例 2:响应式 Flex 布局

<div class="d-flex flex-column flex-md-row justify-content-md-center align-items-md-center" style="height: 150px; background-color: #0dcaf0;"><div class="p-2">项目1</div><div class="p-2">项目2</div><div class="p-2">项目3</div>
</div>

解析

  • .d-flex flex-column flex-md-row:在中等及以上屏幕尺寸下使用水平方向排列,其他情况下使用垂直方向排列。
  • .justify-content-md-center:在中等及以上屏幕尺寸下在主轴(水平方向)上居中对齐。
  • .align-items-md-center:在中等及以上屏幕尺寸下在交叉轴(垂直方向)上居中对齐。
  • style="height: 150px; background-color: #0dcaf0;":设置容器高度和背景色。

示例 3:Flex 项目对齐

<div class="d-flex align-items-start" style="height: 100px; background-color: #f0ad4e;"><div class="p-2">顶部对齐</div><div class="p-2 align-self-center">居中对齐</div><div class="p-2 align-self-end">底部对齐</div>
</div>

解析

  • .d-flex align-items-start:设置为 Flex 容器,并在交叉轴(垂直方向)上顶部对齐。
  • .align-self-center.align-self-end:分别设置单个项目的交叉轴对齐方式。

六、总结

Bootstrap 5 提供了丰富的 Flexbox 工具类,使得布局设计更加简洁和高效。通过掌握这些工具类,可以轻松创建复杂且响应式的布局。以下是一些关键点:

  • 容器设置:使用 .d-flex.d-inline-flex 来启用 Flex 布局。
  • 方向与换行:控制 Flex 方向和是否换行。
  • 对齐与分布:使用 justify-content-*align-items-* 类来控制对齐方式。
  • Flex 属性:控制子元素的伸缩行为。
  • 间距控制:使用 Bootstrap 的间距工具类来管理元素之间的间距。

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

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

相关文章

HarmonyOS 5智能单词应用开发:记忆卡(附:源码

一、应用概述与核心价值 在语言学习过程中&#xff0c;单词记忆是基础也是难点。本文介绍的智能单词记忆卡应用通过创新的交互设计和科学的学习模式&#xff0c;帮助用户高效记忆单词。应用采用ArkUI框架开发&#xff0c;主要特点包括&#xff1a; 双模式学习系统&#xff1a…

LeetCode--38.外观数列

前言&#xff1a;之前我不是说&#xff0c;我后续可能会讲一下递归吗&#xff0c;现在它来了&#xff0c;这道题会用到回溯的方法&#xff0c;并且比较纯粹哦 解题思路&#xff1a; 1.获取信息&#xff1a;&#xff08;下面这些信息差不多是力扣上面的题目信息了&#xff0c;所…

服务器的安装与安全设置

1&#xff1a;安装操作系统 1、创建虚拟机Win49&#xff08;49为序号&#xff09;&#xff0c;并安装Windows Server 2019操作系统 参考配置&#xff1a;安装系统的分区大小为20GB&#xff0c;其余分区暂不划分&#xff0c; 文件系统格式为NTFS&#…

Sensodrive SensoJoint机器人力控关节模组抗振动+Sensodrive力反馈系统精准对接

Sensodrive成立于2003年&#xff0c;起源于德国航空航天中心&#xff08;DLR&#xff09;的LBR项目。公司由一批传感器技术专家创立&#xff0c;专注于高精度工业扭矩传感器的研发。凭借二十余年的技术积累&#xff0c;Sensodrive将DLR轻型机器人扭矩技术引入工业领域&#xff…

【AI实践】Mac一天熟悉AI模型智能体应用(百炼版)

25.6.29增加Gummy 实时/一句话语音识别25.6.28增加Qwen TTS本地音频和实时播报 背景 准备环境 MacOS M1电脑&#xff08;其他M系列芯片也可以&#xff09; 为了方便python的使用环境&#xff0c;使用Miniconda&#xff1a;下载链接&#xff1a;Download Anaconda Distribution…

WEB安全--Java安全--jsp webshell免杀1

1.1、BCEL ClassLoader 介绍&#xff08;仅适用于BCEL 6.0以下&#xff09;&#xff1a; BCEL&#xff08;Apache Commons BCEL™&#xff09;是一个用于分析、创建和操纵Java类文件的工具库&#xff1b;BCEL的类加载器在解析类名时会对ClassName中有$$BCEL$$标识的类做特殊处…

Valkey与Redis评估对比:开源替代方案的技术演进

#作者&#xff1a;朱雷 文章目录 1 概述1.1内存数据结构存储核心特性1.2主流内存数据结构存储设计与适用场景1.3目前主流内存数据结构存储对比 2 Valkey 说明2.1 哨兵架构设计2.2 集群架构设计2.3 valkey 使用企业和业内生态‌ 3 评估指标4 评估结果 1 概述 内存数据结构存储…

华为云Flexus+DeepSeek征文 | 基于华为云ModelArts Studio安装NoteGen AI笔记应用程序

华为云FlexusDeepSeek征文 | 基于华为云ModelArts Studio安装NoteGen AI笔记应用程序 引言一、ModelArts Studio平台介绍华为云ModelArts Studio简介ModelArts Studio主要特点 二、NoteGen介绍NoteGen简介主要特点 三、安装NoteGen工具下载NoteGen软件安装NoteGen工具 四、开通…

BUUCTF在线评测-练习场-WebCTF习题[BJDCTF2020]Easy MD51-flag获取、解析

解题思路 打开靶场&#xff0c;有个提交框&#xff0c;输入后url会出现我们提交的参数password http://a48577ed-9a1c-4751-aba0-ae99f1eb8143.node5.buuoj.cn:81/leveldo4.php?password123 查看源码并没用发现什么猫腻&#xff0c;抓包在响应头发现了猫腻 hint: select * …

面向对象三大特性深度解析:封装、继承与多态

面向对象三大特性深度解析&#xff1a;封装、继承与多态 思维导图概览 #mermaid-svg-v2u0XIzKotjyXYei {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-v2u0XIzKotjyXYei .error-icon{fill:#552222;}#mermaid-svg-v2…

mmap映射物理内存之三invalid cache

目录 流程设计 invalid 命令 内核态invalid 内核态invalid&#xff0c;用户态mmap物理地址 PAN机制 PAN机制历程 硬件支持 ARMv8.1-PAN 特性 Linux 内核的适配 软件模拟 PAN&#xff08;SW PAN&#xff09; 背景 Linux 的实现 总结 前述刷新cache的流程也同样可…

记忆化搜索(dfs+memo)无环有向图

这是一道可以当作板子的极简记忆化搜索 建立a 是邻接表&#xff0c;其中 a[x] 存储从节点 x 出发能到达的所有节点。 b[x] 记录从节点 x 出发的所有边的权重之和。根据数学原理&#xff0c;我们很容易发现&#xff0c;一个根&#xff08;起点&#xff09;的期望&#xff0c;等…

使用AI豆包写一个车辆信息管理页面

记录一个基本的车辆信息管理页面&#xff0c;由豆包撰写完成&#xff0c;只需要微调页面即可。 主要功能是车辆信息的查询、新增、编辑&#xff0c;项目用到了uniapp、vue3、ts、uni-ui、z-paging 页面效果如下&#xff1a; 以上界面均由豆包生成&#xff0c;完成度非常高&am…

《HarmonyOSNext应用防崩指南:30秒定位JS Crash的破案手册》

《HarmonyOSNext应用防崩指南&#xff1a;30秒定位JS Crash的破案手册》 ##Harmony OS Next ##Ark Ts ##教育 本文适用于教育科普行业进行学习&#xff0c;有错误之处请指出我会修改。 &#x1f4a5; 哇哦&#xff01;JS Crash崩溃日志完全解析手册 当你的应用突然闪退时&am…

阅读笔记(3) 单层网络:回归(下)

阅读笔记(3) 单层网络:回归(下) 该笔记是DataWhale组队学习计划&#xff08;共度AI新圣经&#xff1a;深度学习基础与概念&#xff09;的Task03 以下内容为个人理解&#xff0c;可能存在不准确或疏漏之处&#xff0c;请以教材为主。 1. 为什么书上要提到决策理论&#xff1f; …

Mac OS系统每次开机启动后,提示:输入密码来解锁磁盘“Data”,去除提示的解决方法

问题描述&#xff1a; Mac mini外接了一个磁盘&#xff08;EX_Mac&#xff09;为默认使用的系统盘&#xff0c;内置的硬盘&#xff08;Macintosh HD&#xff09;为Mac mini自带的系统盘 外置硬盘系统每次开机都会挂载内置磁盘&#xff0c;同时会提示需要输入密码来解锁磁盘“…

CSS Flex 布局中flex-shrink: 0使用

flex-shrink: 0 是 CSS Flexbox 布局中的一个关键属性&#xff0c;用于禁止弹性项目&#xff08;flex item&#xff09;在容器空间不足时被压缩。以下是详细解释和示例&#xff1a; 核心作用 当容器的可用空间小于所有弹性项目的总宽度&#xff08;或高度&#xff09;时&#…

WHERE 子句中使用子查询:深度解析与最佳实践

&#x1f50d; WHERE 子句中使用子查询&#xff1a;深度解析与最佳实践 在 WHERE 子句中使用子查询是 SQL 的高阶技巧&#xff0c;可实现动态条件过滤。以下是全面指南&#xff0c;涵盖语法、类型、陷阱及优化策略&#xff1a; &#x1f4dc; 一、基础语法结构 SELECT 列 FR…

从0到1:不文明现象随手拍小程序开发日记(一)

前期调研 不文明现象随手拍小程序&#xff1a;在城市的快速发展进程中&#xff0c;不文明现象时有发生&#xff0c;为了有效解决这一问题&#xff0c;提升城市文明程度&#xff0c; 市民若发现不文明行为&#xff0c;如乱扔垃圾、随地吐痰、破坏公共设施、违规停车等&#xff…

STM32F103之SPI软件读写W25Q64

一、W25Q64简介 1.1 简介 W25Q64(Nor flash)、 24位地址&#xff0c;64Mbit/8MByte、是一种低成本、小型化、使用简单的非易失性存储器&#xff0c;常用于数据存储、字库存储、固件程序存储等场景 时钟频率&#xff1a;最大80MHz(STM32F103系统时钟为72MHz…