web网页开发-html与css
1 HTML
html 是一种标记语言,语法是写各种的标签
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <div></div>
<span></span>
<h1></h1>
<strong></strong>
<a herf = "wizard-lhx.github.io"></a>
<video src = "" controls></video>
<input type = "text">
<button>按钮</button>
|
2 CSS
CSS 是用来设计网页布局的样式表
2.1 盒状模型
任何网页都可以理解为一个个盒子进行嵌套、排列。
1 2 3 4 5 6 7 8 9 10 11
| <div style="border: solid black; padding:2px; margin: 5px; box-shadow: 0 0 0 2px #fff"></div>
<div class="box"></div> <style> .box{ border: solid black; padding:2px; margin: 5px; box-shadow: : 0 0 0 2px #fff; } </style>
|

2.2 FLEX 布局
使用 flex 布局容易使其子元素对齐
1 2 3 4 5
| <div style="display: flex; flex-direction: row;justify-content: flex-start;align-items: center"> <div style="width: 20px;height: 20px"></div> <div style="width: 10px;height: 40px"></div> </div>
|
2.3 字体格式
1 2
| <!--字体大小、粗细、颜色--> <span style="font-size: 5px;font-weight: normal;color: blue">hello</span>
|
3 检查网页样式
在网页中按下Fn+F12打开浏览器检查窗口。点击检查元素图标可以快速定位样式。
