常⽤属性
- 盒⼦的位置和⼤⼩
尺⼨ 宽度 width: ⻓度|百分⽐|auto ⾼度 height 边界 margin padding 上右下左|上下左右
- 布局
浮动:float 定位:position 弹性布局:flex 盒⼦内容超出部分:overflow:hidden | scroll | auto
- 外观,⻛格
background-image background-repeat background-size background-position background-color
- ⽂字属性
字体⼤⼩ font-size 是否加粗 font-weight 是不是斜体 font-style 字体是什么 font-family
- 代码案例
<!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: 100px; height: 100px; background-color: red; /* float: left; */ } .boxs { width: 100px; height: 100px; background-color: blue; /* float: right; */ /* position: absolute; top: 0; left: 100px; */ overflow: auto; } .father { display: flex; } .image { width: 200px; height: 200px; background-color: red; /* background-image: url('https://file.xdclass.net/xdclass/xdclass_logo.png'); background-repeat: no-repeat; background-size: 100%; background-position: bottom; */ /* background: red url('https://file.xdclass.net/xdclass/xdclass_logo.png') no-repeat bottom; background-size: 100%; */ font-size: 10px; font-weight: 600; font-style: italic; font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif; } </style> </head> <body> <!-- <div class="father"> <div class="box"></div> <div class="boxs"> Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit dignissimos cum deleniti explicabo beatae error pariatur illo inventore quos ipsum! </div> </div> --> <div class="image"> 小滴课堂 </div> </body> </html>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术
2021-08-31 vue开发:前端项目模板