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

前端开发零基础

全栈开发路线

html是基础框架,css是锦上添花

创建文件后打出!生成基础框架

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>hello</title><!--网页名--> </head> <body> <h1>Hello, World!</h1> <input type="text"/><!--输入框及输入类型--> <img src="image.jpg" alt="Sample Image"/><!--图片及image.jpg图片路径--> <div class="box"></div><!--块级元素--> <div class="box1"></div><!--块级元素--> <div class="box"></div><!--块级元素--> <style> div{ width: 100px; height: 100px; background-color: lightblue; } .box{ margin-top: 10px; width: 100px; height: 100px; background-color:black; } .box1{ margin-top: 10px; width: 100px; height: 100px; background-color:rgb(5, 53, 247); } </style><!--块级元素样式,有选择器之后,div定义的块无效显示--> </body> </html>

网页效果

创建div块的快捷方式

直接div.名称+回车快速创建

想要做出在框内的嵌套效果,需要将新的div框写在原有底层框的双标之内

margin塌陷问题,无法改变标题位置,块内改变的上边距仍然改变的是外边距

给外边框使用pandding相对位置

.todo{ width: 98%; height: 500px; padding-top: 30px; box-sizing: border-box;这一行使块大小不因为pandding发生变化 background-color: #ffff; border-radius: 5px; margin-top: 40px; margin-left: 1%; } .title{ font-size: 30px; font-weight: 900; text-align: center; }

两div横向排列,在外部div加display: flex;

div块与span块的区别,div默认竖排,span默认横排

整体代码

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div class="todo"> <div class="title">我的一天</div> <div class="todo-form"> <input class="todo-input" type="text" placeholder="你今天要干嘛"> <div class="todo-button">add todo</div> </div> <div class="item completed"> <div> <input type="checkbox"> <span class="name">吃早饭</span> </div> <div class="del">del</div> </div> <div class="item"> <div> <input type="checkbox"> <span class="name">吃午饭</span> </div> <div class="del">del</div> </div> <div class="item"> <div> <input type="checkbox"> <span class="name">吃晚饭</span> </div> <div class="del">del</div> </div> </div> <!--设置背景渐变色--> <style> .completed{ text-decoration: line-through; opacity: 0.4; } .del{ color: red; } .item{ display: flex; align-items: center; justify-content: space-between; border-radius: 20px; box-sizing: border-box; width: 80%; height: 50px; margin: 8px auto; padding: 16px; border-radius: 20px; box-shadow: rgba(149,157,165,0.2)0px 8px 20px; } .todo-button{ width: 100px; height: 52px; border-radius: 0 20px 20px 0; text-align: center; background: linear-gradient( to right, rgb(113, 66, 113), rgb(56, 56, 197)); color: #ffff; line-height: 52px; user-select: none; cursor: pointer; } .todo-input{ margin-bottom: 20px; padding-left: 15px; border: 1px solid #dfe1e5; outline: none; width: 60%; height: 50px; border-radius: 20px 0 0 20px; } .todo-form{ display: flex; margin-top: 20px; margin-left: 30px; } body { background: linear-gradient( to right, rgb(113, 66, 113), rgb(56, 56, 197)); } .todo{ width: 98%; height: 500px; padding-top: 30px; box-sizing: border-box; background-color: #ffff; border-radius: 5px; margin-top: 40px; margin-left: 1%; } .title{ font-size: 30px; font-weight: 900; text-align: center; } </style> </body> </html>

效果展示

http://www.jsqmd.com/news/84782/

相关文章:

  • Day 38 官方文档的阅读
  • 备自投装置检查要求
  • PyTorch + OpenMMLab 等专用计算机视觉框架介绍
  • Scarab模组管理器:空洞骑士MOD管理的终极解决方案
  • 论文AI率从100%降到2.8%,5个免费查AI率和降AI率工具就够了!
  • XPath 简介:在 XML 和 HTML 中的应用
  • 结合Dinov2和YOLO介绍深度学习三层(输入、隐藏、输出)
  • AI搜索排名GEO优化零售行业案例分享
  • 鸿蒙负一屏的技术定位与核心价值
  • AI搜索排名GEO优制造业案例分享
  • Easily Activate Proton License for Lonsdor K518 Pro FCV Key Programmer
  • (强烈推荐)不用Spring的Autowire且能看出依赖关系的写法
  • 【论文阅读 TIV 2024 CDC-YOLOFusion 利用跨尺度动态卷积融合实现可见光-红外目标检测】
  • 简单升压稳压电路 LTspice 结果
  • 实习刷题11
  • ComfyUI中的节点兼容性检测机制说明
  • 蚂蚁百灵团队开源100亿参数模型Ring-flash-2.0:激活效率提升16倍,推理性能超越同类模型
  • 二分查找与搜索算法
  • 1、利用树莓派3和Kali Linux构建低成本便携式渗透测试平台
  • 2、搭建低成本高效渗透测试平台指南
  • 3、打造强大渗透测试平台:树莓派与Kali Linux的完美结合
  • 6、渗透测试:从准备到执行
  • 排序算法汇总以及java实现
  • Mac 真人手势识别切水果游戏
  • 7、渗透测试:计划与目标探索
  • MySQL进阶篇——InnoDB存储引擎和管理
  • MySQL运维篇——日志和主从复制
  • 北京历年住房公积金月缴存额上限及同比增长率表
  • AMD发布Nitro-E轻量级扩散模型:304M参数实现文本到图像高效生成
  • 8、探索目标:侦察与武器化