html中一些实用代码以及其作用(cursor,box-sizing,transition)

博客介绍了前端相关知识,包括鼠标样式cursor、标准与怪异盒子模型、过渡效果transition,还提到transform可让图片有突出效果。此外,介绍了Transformer,它抛弃传统CNN和RNN,由self - Attention和Feed Forward Neural Network组成,在机器翻译中有出色表现。
部署运行你感兴趣的模型镜像

1.cursor: pointer 当鼠标移上去,变成手的形状 ,移出去还原

2.标准盒子模型,一般浏览器也都默认为标准盒子模型。即:box-sizing:content-box

   怪异盒子模型,一般根据实际项目需要自行设置。即:box-sizing:border-box

加了box-sizing:border-box属性,padding和border的值就不会在影响元素的宽高,相当于把padding和border的值都算在content里

盒子模型会自动根据padding和border的值来调整content的值,就不需要手动调整

3. transition: all .4s; 给所有过渡效果(单位s)

可以用在css中的过渡动画,.4s可以进行修改,是过渡所用的时间

4.  transform: translateY(-2px);

让图片有一点突出效果

最后介绍一下transform,这个transform在网页布局中的一些动态效果经常用

Transform简介

Transformer中抛弃了传统的CNN和RNN,整个网络结构完全是由Attention机制组成。更准确地讲,Transformer由且仅由self-Attenion和Feed Forward Neural Network组成。一个基于Transformer的可训练的神经网络可以通过堆叠Transformer的形式进行搭建,作者的实验是通过搭建编码器和解码器各6层,总共12层的Encoder-Decoder,并在机器翻译中取得了BLEU值得新高。
 

您可能感兴趣的与本文相关的镜像

Langchain-Chatchat

Langchain-Chatchat

AI应用
Langchain

Langchain-Chatchat 是一个基于 ChatGLM 等大语言模型和 Langchain 应用框架实现的开源项目,旨在构建一个可以离线部署的本地知识库问答系统。它通过检索增强生成 (RAG) 的方法,让用户能够以自然语言与本地文件、数据库或搜索引擎进行交互,并支持多种大模型和向量数据库的集成,以及提供 WebUI 和 API 服务

<div class="container"> <div class="top"> <div class="top-left"> <div class="top-left-side"> </div> <div class="top-left-content"> <div class="logo"> <img src="plugin_assets/polls/images/icon-company.png" alt="公司图标"> <div class="logo-text"> <div class="company-name">武汉光庭信息技术股份有限...</div> <div class="platform-name">数字化学习平台</div> </div> </div> <div class="nav"> <div class="nav-item"> <img src="plugin_assets/polls/images/icon-home.png" alt="首页"> <span>首页</span> </div> <div class="nav-item"> <img src="plugin_assets/polls/images/icon_study.png" alt="学习中心"> <span>学习中心</span> </div> <div class="nav-item"> <img src="plugin_assets/polls/images/icon_shop.png" alt="知识商城"> <span>知识商城</span> </div> <div class="nav-item"> <img src="plugin_assets/polls/images/icon_profile.png" alt="个人中心"> <span>个人中心</span> </div> </div> </div> </div> <div class="top-right"> <div class="search"> <label> <input type="text" placeholder="请输入想要的内容"> </label> <a class="search-icon">🔍︎</a> </div> </div> </div> <div class="home-tabs-container"> <div id="home-tab1-content" class="home-tab-content" style="display: block;"> 首页 </div> <div id="home-tab2-content" class="home-tab-content" style="display: none;"> 学习中心 </div> </div> </div> <style> * { box-sizing: border-box; margin: 0; padding: 0; } html, body { height: 100%; } .container { display: flex; flex-direction: column; height: 100vh; } /*********************top****************************/ .top { height: 10vh; background-color: #f0f0f0; /*border-bottom: 1px solid #ccc;*/ display: flex; box-sizing: border-box; background-color: hsla(0, 0%, 100%, 0.6); } .top-left { flex: 0 0 66.5%; display: flex; align-items: center; } .top-left-side { flex: 1; display: flex; align-items: center; } .top-left-content { flex: 0 0 70%; display: flex; align-items: center; gap: 20px; } .top-right { display: flex; align-items: center; justify-content: flex-start; } .logo { display: flex; align-items: center; } .logo img { width: 38px; height: 38px; margin-right: 16px; } .logo-text { display: flex; flex-direction: column; overflow: hidden; } .company-name { font-size: 18px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } .platform-name { font-size: 14px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } .nav { display: flex; gap: 25px; justify-content: flex-start; } .nav-item { display: flex; flex-direction: row; align-items: center; white-space: nowrap; gap: 3px; font-size: 16px; color: #a9a9a9; text-decoration: none; transition: color 0.3s; } .nav-item img { width: 20px; height: 20px; flex-shrink: 0; display: block; } .nav-item:hover { color: #007bff; } .search { flex: 0 0 285px; position: relative; max-width: 400px; display: inline-block; } .search input { width: 100%; height: 30px; padding-left: 35px; font-size: 14px; border: 1px solid #759fcf; border-radius: 4px; box-sizing: border-box; } .search-icon { position: absolute; left: 0; top: 0; height: 100%; width: 30px; display: flex; align-items: center; justify-content: center; pointer-events: none; color: #888; font-size: 16px; background: transparent; border: none; } /*********************bottom****************************/ .bottom { flex: 1; background-color: rgba(242, 242, 242, 0.3); position: relative; } .home-content { position: absolute; top: 17px; bottom: 0; /* 保持原有值 */ width: 100%; } .left-content { min-width: 870px; position: absolute; left: 18.3%; top: 0; height: 100%; /*width: 47%;*/ width: 870px; padding: 0; box-sizing: border-box; /*border-right: 1px solid #ccc;*/ /*border-left: 1px solid #ccc;*/ } /************************carousel***********************************************/ .carousel-container { /*height: 37%;*/ height: 314px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); margin-bottom: 19px; padding: 30px; } .carousel-inner { width: 100%; height: 100%; padding: 0; background-color: rgba(179, 179, 179, 0.3); position: relative; display: inline-block; } .carousel-text { position: absolute; top: 87%; left: 32%; transform: translate(-50%, -50%); color: white; font-size: 24px; font-weight: bold; text-shadow: 1px 1px 2px black; z-index: 999; } .carousel-inner-img { max-width: 60%; height: 100%; margin-left: 21%; box-shadow: -25px 0 20px rgba(255, 255, 255, 0.5), 25px 0 20px rgba(255, 255, 255, 0.5); } /************************banner***********************************************/ .banner-container { display: flex; gap: 100px; justify-content: flex-start; height: 94px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); margin-bottom: 19px; padding-left: 4%; } .banner-item { display: flex; flex-direction: row; align-items: center; white-space: nowrap; gap: 3px; font-size: 16px; color: #a9a9a9; text-decoration: none; cursor: pointer; } .banner-item:hover { color: #a9a9a9; } .banner-item img { width: 55px; height: 55px; flex-shrink: 0; display: block; } /************************@TODO content-card***********************************************/ .content-card { position: relative; width: 48%; height: 83%; background-color: #fff; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); padding: 20px; margin: 10px 0; transition: transform 0.2s; } /************************task***********************************************/ .task-container { /*height: 20%;*/ height: 323px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); margin-bottom: 19px; } .task-title { height: 20%; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); padding-left: 20px; padding-right: 25px; display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 15px; } .task-title-span { font-size: 18px; flex: 0 0 auto; } .task-tabs-container { display: flex; gap: 2px; flex: 1 1 auto; font-size: 14px; color: #a9a9a9; margin-left: 5%; } .task-tabs { margin-right: 4.5%; transition: color 0.3s; } .task-tabs > span { position: relative; padding-bottom: 40%; cursor: pointer; color: #a9a9a9; } .task-tabs > span:hover { cursor: pointer; } .task-tabs.active span { color: #007bff; position: relative; padding-bottom: 40%; } .task-tabs.active span::after { content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; height: 2px; background-color: #007bff; border-radius: 2px; } .task-all-tab { flex: 0 0 auto; color: #3798fb; font-size: 16px; cursor: pointer; transition: color 0.3s ease; } .task-all-tab:hover { color: #007bff; } .task-content { height: 80%; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); } .task-tab-content { position: relative; height: 100%; width: 100%; } .task-content-card { position: relative; background-color: #fff; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); transition: transform 0.2s; width: 20%; height: 80%; margin-left: 2%; margin-top: 2%; } .task-content-card:hover { transform: translateY(-2px); } .task-card-header { position: relative; height: 50%; } .task-card-image { position: relative; height: 100%; width: 100%; border-radius: 5px 5px 0 0; } .task-card-image-text { position: absolute; top: 87%; left: 15%; transform: translate(-50%, -50%); color: white; font-size: 14px; /*font-weight: bold;*/ text-shadow: 1px 1px 2px black; z-index: 999; } .task-card-body { position: relative; } .task-card-title { position: relative; padding-left: 4%; margin-bottom: 2%; font-size: 17px; font-weight: 300; flex: 0 0 auto; } .task-card-progress { position: relative; padding-left: 4%; margin-bottom: 2%; color: #f66; } .task-card-deadline { position: relative; padding-left: 4%; color: #555; } .task-exam-card { display: flex; position: relative; flex-direction: column; align-items: center; text-align: center; } .task-exam-card-image { margin-top: 5%; position: relative; width: 14%; height: auto; } .task-exam-card-tips { position: relative; margin-top: 3%; color: #555; font-size: 17px; font-weight: 300; } /*****************************new-training******************************************************/ .new-training-container { /*height: 20%;*/ height: 220px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); margin-bottom: 19px; } .new-training-title { height: 64px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); padding-left: 20px; padding-right: 25px; display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 15px; } .new-training-title-span { font-size: 18px; flex: 0 0 auto; } .new-training-title-all { flex: 0 0 auto; color: #3798fb; font-size: 16px; cursor: pointer; transition: color 0.3s ease; } .new-training-title-all:hover { color: #007bff; } .new-training-content { height: auto; background-color: rgba(255, 255, 255, 1); display: flex; flex-wrap: wrap; gap: 2%; margin-top: 2%; margin-left: 2%; } .new-training-content-card { position: relative; width: 48%; height: 20%; background-color: #fff; border: 1px solid #e0e0e0; border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); transition: transform 0.2s; display: flex; flex-direction: row; box-sizing: border-box; margin-bottom: 2%; } .new-training-card-left-section { flex: 31%; display: flex; flex-direction: column; padding: 10px; box-sizing: border-box; margin-left: 8px } .new-training-card-text { font-size: 14px; font-weight: 200; flex: 0 0 auto; color: #555; } .new-training-card-right-section { flex: 60%; display: flex; flex-direction: column; padding: 5px; box-sizing: border-box; justify-content: space-between; } .new-training-card-title { font-size: 16px; font-weight: 380; flex: 0 0 auto; margin-bottom: 4%; } .new-training-card-summary { font-size: 12px; width: 85%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 29ch; } .new-training-vertical-line { width: 1px; height: 23%; background-color: #ccc; margin-bottom: 4%; margin-left: 10%; margin-right: 10%; } .new-training-card-actions { display: flex; align-items: flex-end; flex: 1; margin-left: 59%; } /*****************************training******************************************************/ .training-container { /*height: 20%;*/ height: 349px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); margin-bottom: 19px;; } .training-title { height: 64px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); padding-left: 20px; padding-right: 25px; display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 15px; } .training-title-span { font-size: 18px; flex: 0 0 auto; } .training-title-all { flex: 0 0 auto; color: #3798fb; font-size: 16px; cursor: pointer; transition: color 0.3s ease; } .training-title-all:hover { color: #007bff; } .training-content { height: auto; background-color: rgba(255, 255, 255, 1); display: flex; flex-wrap: wrap; gap: 2%; margin-top: 2%; margin-left: 2%; align-items: stretch; /* 强制子元素高度一致 */ } .training-content-card { position: relative; width: 48%; height: auto; background-color: #fff; border: 1px solid #e0e0e0; border-radius: 4px; transition: transform 0.2s; display: flex; flex-direction: row; box-sizing: border-box; margin-bottom: 2%; } .training-content-card:hover { transform: translateY(-2px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 25px rgba(180, 180, 180, 0.8); } .training-card-left-section { flex: 31%; display: flex; flex-direction: column; padding: 10px; box-sizing: border-box; margin-left: 8px } .training-card-image-cover { height: 67px; width: 120px; border-radius: 5px; margin-bottom: 6%; } .training-card-image-text{ position: absolute; top: 57%; left: 14%; transform: translate(-50%, -50%); color: white; font-size: 13px; text-shadow: 1px 1px 2px black; z-index: 999; writing-mode: horizontal-tb; text-align: left; } .training-card-text { font-size: 14px; font-weight: 200; flex: 0 0 auto; color: #555; width: 87%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 29ch; } .training-card-image-wrapper img { max-width: 100%; max-height: 100%; /*object-fit: cover;*/ object-fit: fill; /* 拉伸图片以完全覆盖容器 */ border-radius: 3px; } .training-card-right-section { flex: 60%; display: flex; flex-direction: column; padding: 5px; box-sizing: border-box; justify-content: space-between; } .training-card-title { font-size: 15px; font-weight: 380; flex: 0 0 auto; margin-bottom: 4%; width: 97%; max-width: 29ch; } .training-card-summary { font-size: 12px; width: 85%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 29ch; } .training-vertical-line { width: 1px; height: 23%; background-color: #ccc; margin-bottom: 4%; margin-left: 10%; margin-right: 10%; } .training-card-actions { display: flex; align-items: flex-end; flex: 1; margin-left: 59%; } /*****************************courses******************************************************/ .courses-container { /*height: 20%;*/ height: 349px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); margin-bottom: 19px;; } .courses-title { height: 64px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); padding-left: 20px; padding-right: 25px; display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 15px; } .courses-title-span { font-size: 18px; flex: 0 0 auto; } .courses-title-all { flex: 0 0 auto; color: #3798fb; font-size: 16px; cursor: pointer; transition: color 0.3s ease; } .courses-title-all:hover { color: #007bff; } .courses-content { height: auto; background-color: rgba(255, 255, 255, 1); display: flex; flex-wrap: wrap; gap: 2%; margin-top: 2%; margin-left: 2%; align-items: stretch; /* 强制子元素高度一致 */ } .courses-content-card { position: relative; width: 48%; height: auto; background-color: #fff; border: 1px solid #e0e0e0; border-radius: 4px; transition: transform 0.2s; display: flex; flex-direction: row; box-sizing: border-box; margin-bottom: 2%; } .courses-content-card:hover { transform: translateY(-2px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 25px rgba(180, 180, 180, 0.8); } .courses-card-left-section { flex: 31%; display: flex; flex-direction: column; padding: 10px; box-sizing: border-box; margin-left: 8px } .courses-card-image-cover { height: 67px; width: 120px; border-radius: 5px; margin-bottom: 6%; } .courses-card-image-text{ position: absolute; top: 57%; left: 18%; transform: translate(-50%, -50%); color: white; font-size: 13px; text-shadow: 1px 1px 2px black; z-index: 999; writing-mode: horizontal-tb; text-align: left; } .courses-card-image-icon{ position: absolute; top: 36%; left: 16%; transform: translate(-50%, -50%); color: white; font-size: 13px; text-shadow: 1px 1px 2px black; z-index: 999; writing-mode: horizontal-tb; text-align: left; width: 19px; height: 19px; } .courses-card-text { font-size: 14px; font-weight: 200; flex: 0 0 auto; color: #555; width: 87%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 29ch; } .courses-card-image-wrapper img { max-width: 100%; max-height: 100%; /*object-fit: cover;*/ object-fit: fill; /* 拉伸图片以完全覆盖容器 */ border-radius: 3px; } .courses-card-right-section { flex: 60%; display: flex; flex-direction: column; padding: 5px; box-sizing: border-box; justify-content: space-between; } .courses-card-title { font-size: 15px; font-weight: 380; flex: 0 0 auto; margin-bottom: 4%; width: 97%; max-width: 29ch; } .courses-card-summary { font-size: 12px; width: 85%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 29ch; } .courses-vertical-line { width: 1px; height: 23%; background-color: #ccc; margin-bottom: 4%; margin-left: 10%; margin-right: 10%; } .courses-card-actions { display: flex; align-items: flex-end; flex: 1; margin-left: 25%; } /*****************************exam******************************************************/ .exam-container { /*height: 20%;*/ height: 349px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); margin-bottom: 50px; } .exam-title { height: 64px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); padding-left: 20px; padding-right: 25px; display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 15px; } .exam-title-span { font-size: 18px; flex: 0 0 auto; } .exam-title-all { flex: 0 0 auto; color: #3798fb; font-size: 16px; cursor: pointer; transition: color 0.3s ease; } .exam-title-all:hover { color: #007bff; } .exam-content { height: auto; background-color: rgba(255, 255, 255, 1); display: flex; flex-wrap: wrap; gap: 2%; margin-top: 2%; margin-left: 2%; align-items: stretch; } .exam-content-card { position: relative; width: 48%; height: auto; background-color: #fff; border: 1px solid #e0e0e0; border-radius: 4px; transition: transform 0.2s; display: flex; flex-direction: row; box-sizing: border-box; margin-bottom: 2%; } .exam-content-card:hover { transform: translateY(-2px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 25px rgba(180, 180, 180, 0.8); } .exam-card-left-section { flex: 31%; display: flex; flex-direction: column; padding: 10px; box-sizing: border-box; margin-left: 8px } .exam-card-image-cover { height: 67px; width: 120px; border-radius: 5px; margin-bottom: 6%; } .exam-card-image-text{ position: absolute; top: 57%; left: 14%; transform: translate(-50%, -50%); color: white; font-size: 13px; text-shadow: 1px 1px 2px black; z-index: 999; writing-mode: horizontal-tb; text-align: left; } .exam-card-text { font-size: 14px; font-weight: 200; flex: 0 0 auto; color: #a9a9a9; width: 87%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 29ch; } .exam-card-image-wrapper img { max-width: 100%; max-height: 100%; object-fit: fill; border-radius: 3px; } .exam-card-right-section { flex: 60%; display: flex; flex-direction: column; padding: 5px; box-sizing: border-box; justify-content: space-between; } .exam-card-title { font-size: 15px; font-weight: 380; flex: 0 0 auto; margin-bottom: 4%; width: 97%; max-width: 29ch; } .exam-card-summary { font-size: 12px; width: 85%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 29ch; } .exam-card-actions { display: flex; align-items: flex-end; /*flex: 1;*/ margin-left: 61%; margin-bottom: 7%; font-size: 14px; font-weight: 300; flex: 0 0 auto; color: #555; } /*****************************content-gap******************************************************/ .content-gap { height: 1px } /*****************************home-right******************************************************/ .right-side { position: absolute; right: 0; top: 0; width: 33.8%; height: 100%; padding: 0; background-color: rgba(255, 255, 255, 0.6); box-sizing: border-box; /*border-left: 1px solid #ccc;*/ min-width: 200px; } /*****************************home-user-profile ******************************************************/ .home-user-profile { width: 290px; height: 247px; position: relative; box-sizing: border-box; background-color: #fff; border-radius: 5px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); margin-left: 1%; margin-bottom: 3%; } .home-user-profile-header { height: 70%; display: flex; flex-direction: column; padding: 10px; box-sizing: border-box; justify-content: center; align-items: center; width: 100%; } .home-user-circle-container { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; position: relative; margin-bottom: 2%; } .home-user-circle-name{ font-size: 18px; flex: 0 0 auto; margin-bottom: 2%; } .home-user-circle-detail{ font-size: 12px; font-weight: 300; flex: 0 0 auto; color: #a9a9a9; } .home-user-circle-image { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; } .home-user-profile-content { flex: 1 0 30%; display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 0; } .home-user-content-section { padding: 10px; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; } .home-user-content-section:not(:last-child)::after { content: ''; position: absolute; right: 0; top: 39%; height: 41%; width: 1px; background: #e7e3e1; } .home-user-content-section-number { font-size: 14px; font-weight: bolder; margin-bottom: 5px; } .home-user-content-section-desc { font-size: 12px; font-weight: 300; flex: 0 0 auto; color: #a9a9a9; } /*****************************home-top-corp ******************************************************/ .home-top-corp{ width: 290px; height: auto; position: relative; box-sizing: border-box; background-color: #fff; border-radius: 5px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); margin-left: 1%; margin-bottom: 2%; } .home-top-corp-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; height: 60px; position: relative; } .home-top-corp-header-left-item { flex: 0 0 auto; display: flex; align-items: center; } .home-top-corp-header-center-item { flex: 1; text-align: center; } .home-top-corp-header-bold-text { font-weight: 480; font-size: 13px; } .home-top-corp-header-right-item { flex: 0 0 auto; display: flex; align-items: center; margin-left: 14px; } .home-top-corp-header-normal-text { font-size: 14px; flex: 0 0 auto; color: #3798fb; cursor: pointer; transition: color 0.3s ease; } .home-top-corp-header-normal-text:hover { color: #007bff; } .home-top-corp-header-item{ position: relative; border-radius: 4px; height: 60px; width: 100%; align-items: center; display: flex; padding-left: 6%; } .home-top-corp-header-item::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 3%; height: 3px; background-color: rgba(179, 179, 179, 0.3); width: 85%; } .home-top-corp-header-item-blue-circle { display: inline-flex; justify-content: center; align-items: center; width: 35px; height: 35px; background-color: #3798fb; border-radius: 50%; color: white; font-size: 13px; font-weight: 300; } .home-top-corp-header-item-span{ margin-left: 2%; font-size: 15px; font-weight: 500; } .home-top-corp-header-item-desc{ font-size: 12px; font-weight: 300; flex: 0 0 auto; color: #a9a9a9; margin-left: auto; margin-right: 3%; text-align: right; white-space: nowrap; } .home-top-corp-content-item{ position: relative; border-radius: 4px; height: 60px; width: 100%; align-items: center; display: flex; padding-left: 6%; } .home-top-corp-content-item-blue-circle { display: inline-flex; justify-content: center; align-items: center; width: 35px; height: 35px; background-color: #3798fb; border-radius: 50%; color: white; font-size: 13px; font-weight: 300; } .home-top-corp-content-name-group { position: relative; display: flex; flex-direction: column; align-items: flex-start; margin-left: 2%; min-width: 0; } .home-top-corp-content-item-span{ margin-left: 2%; font-size: 15px; font-weight: 500; } .home-top-corp-content-item-custom-icon { position: absolute; right: 116%; bottom: 0; width: 13px; height: auto; margin-left: 8px; } .home-top-corp-content-sub-text { font-size: 12px; font-weight: 200; color: #a9a9a9; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } .home-top-corp-content-item-separator{ content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; height: 1px; background-color: rgba(179, 179, 179, 0.2); width: 87%; } .home-top-corp-content-item-desc{ font-size: 15px; font-weight: 700; flex: 0 0 auto; color: #3798fb; text-align: right; white-space: nowrap; margin-left: auto; margin-right: 8%; } /*****************************home-top-dept ******************************************************/ .home-top-dept{ width: 290px; height: 247px; position: relative; box-sizing: border-box; background-color: #fff; border-radius: 5px; background-color: rgba(255, 255, 255, 1); border: 1px solid rgba(242, 242, 242, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); margin-left: 1%; margin-bottom: 1%; } .home-top-dept-header{ display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; height: 60px; position: relative; } .home-top-dept-header-left-item { flex: 0 0 auto; display: flex; align-items: center; } .home-top-dept-header-center-item { flex: 1; text-align: center; } .home-top-dept-header-bold-text { font-weight: 480; font-size: 13px; } .home-top-dept-header-right-item { flex: 0 0 auto; display: flex; align-items: center; margin-left: 14px; } .home-top-dept-header-normal-text { font-size: 14px; flex: 0 0 auto; color: #3798fb; cursor: pointer; transition: color 0.3s ease; } .home-top-dept-header-normal-text:hover { color: #007bff; } .home-top-dept-header-item{ position: relative; border-radius: 4px; height: 60px; width: 100%; align-items: center; display: flex; padding-left: 6%; } .home-top-dept-header-item::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 3%; height: 3px; background-color: rgba(179, 179, 179, 0.3); width: 85%; } .home-top-dept-header-item-blue-circle { display: inline-flex; justify-content: center; align-items: center; width: 35px; height: 35px; background-color: #3798fb; border-radius: 50%; color: white; font-size: 13px; font-weight: 300; } .home-top-dept-header-item-span{ margin-left: 2%; font-size: 15px; font-weight: 500; } .home-top-dept-header-item-desc{ font-size: 12px; font-weight: 300; flex: 0 0 auto; color: #a9a9a9; margin-left: auto; margin-right: 3%; text-align: right; white-space: nowrap; } .home-top-dept-content-item{ position: relative; border-radius: 4px; height: 60px; width: 100%; align-items: center; display: flex; padding-left: 6%; } .home-top-dept-content-item-blue-circle { display: inline-flex; justify-content: center; align-items: center; width: 35px; height: 35px; background-color: #3798fb; border-radius: 50%; color: white; font-size: 13px; font-weight: 300; } .home-top-dept-content-name-group { position: relative; display: flex; flex-direction: column; align-items: flex-start; margin-left: 2%; min-width: 0; } .home-top-dept-content-item-span{ margin-left: 2%; font-size: 15px; font-weight: 500; } .home-top-dept-content-item-custom-icon { position: absolute; right: 116%; bottom: 0; width: 13px; height: auto; margin-left: 8px; } .home-top-dept-content-sub-text { font-size: 12px; font-weight: 200; color: #a9a9a9; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } .home-top-dept-content-item-separator{ content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; height: 1px; background-color: rgba(179, 179, 179, 0.2); width: 87%; } .home-top-dept-content-item-desc{ font-size: 15px; font-weight: 700; flex: 0 0 auto; color: #3798fb; text-align: right; white-space: nowrap; margin-left: auto; margin-right: 8%; } </style> <script> document.querySelectorAll('.task-tabs').forEach(tab => { tab.addEventListener('click', () => { document.querySelectorAll('.task-tabs').forEach(t => t.classList.remove('active')); tab.classList.add('active'); document.querySelectorAll('.task-tab-content').forEach(content => { content.style.display = 'none'; }); const targetTab = tab.getAttribute('data-tab'); const targetContent = document.getElementById(`task-${targetTab}-content`); if (targetContent) { targetContent.style.display = 'block'; } }); }); </script> 实现点击 首页切换到 对应home-tab1-content 学习中心也是类似
09-23
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>弹性盒子示例</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f0f0; } .flex-container { display: flex; justify-content: space-around; align-items: center; width: 80%; height: 300px; background-color: #fff; border: 1px solid #ccc; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .flex-item { width: 100px; height: 100px; background-color: #00ff0d; display: flex; justify-content: center; align-items: center; color: #fff; font-size: 18px; font-weight: bold; transition: all 0.3s ease; cursor: pointer; } .flex-item:hover { transform: scale(1.1); background-color: #fbff00; box-shadow: 0 0 15px rgba(255, 103, 0, 0.5); } @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } } /* .flex-item:nth-child(1) { animation: bounce 2s infinite; } .flex-item:nth-child(2) { animation: bounce 2s infinite 0.3s; } .flex-item:nth-child(3) { animation: bounce 2s infinite 0.6s; } */ </style> </head> <body> <div class="flex-container"> <div class="flex-item">1</div> <div class="flex-item">2</div> <div class="flex-item">3</div> </div> </body> </html>我需要你改这个代码pc端的横向分布当缩小到移动端变为垂直分布
最新发布
11-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值