news 2026/7/11 5:12:20

前端开发零基础

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
前端开发零基础

全栈开发路线

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>

效果展示

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/7/8 21:49:52

54.分析模式入门-解决复杂业务问题的建模技巧-提升建模能力

54 分析模式入门:解决复杂业务问题的建模技巧 你好,欢迎来到第 54 讲。 在 DDD 的世界里,除了我们已经深入学习的聚合、值对象、限界上下文等核心模式外,还存在一类非常特殊的“模式”——分析模式(Analysis Pattern)。 这个概念,由大师 Martin Fowler 在他的同名著作…

作者头像 李华
网站建设 2026/7/10 20:46:21

58.试点项目选择-3类适合DDD落地项目-避开这些坑项目附选择清单

58 试点项目选择:3 类适合 DDD 落地的项目(避开这些坑项目) 你好,欢迎来到第 58 讲。 在上一讲,我们已经组建好了理想的“梦之队”,并设计了一套高效的协作流程。现在,万事俱备,只欠东风——我们应该选择哪个项目,来打响 DDD 落地的“第一枪”? 这是一个至关重要的…

作者头像 李华
网站建设 2026/7/11 8:14:01

64.企业级案例(上)-金融行业DDD落地全流程支付系统-附架构演进图

64 企业级案例(上):金融行业 DDD 落地全流程(支付系统) 你好,欢迎来到第 64 讲。 经过前面所有章节的学习,我们已经掌握了 DDD 的全套理论、模式与实践方法。现在,是时候将所有知识融会贯通,看一看在一个真实、复杂的企业级项目中,DDD 是如何从 0 到 1,再到 N,完…

作者头像 李华
网站建设 2026/7/11 12:35:37

Day 38 官方文档的阅读

浙大疏锦行 大多数 Python 库都会有官方文档&#xff0c;里面包含了函数的详细说明、用法示例以及版本兼容性信息。 通常查询方式包含以下3种&#xff1a; 1. GitHub 仓库&#xff1a;https://github.com/SauceCat/PDPbox 2. PyPI 页面&#xff1a;https://pypi.org/projec…

作者头像 李华
网站建设 2026/7/9 13:03:09

备自投装置检查要求

1.备自投功能压板、相关开关操作后&#xff0c;如备自投具备启用条件&#xff0c;应检查备自投装置充电指示、方式指示正确。(1)对于备自投日常停启用操作功能压板&#xff0c;其充电正常、方式正确在功能压板投入后检查。 (2)对于备自投日常停启用操作出口压板&#xff0c;其充…

作者头像 李华