ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
>### A.今天学什么? ##### 1.什么是`html`、`css` ``` html负责网页结构,css负责修饰 ``` ##### 2.常用的`html`标签 ``` h1~h6, p, div, a, input, button, ul, li, dl, dt, dd ``` ##### 3.常用的`css`样式 - ##### 3.1`css`基本语法 ``` // HTML <p>hello world</p> ``` ``` // css <style> p{color: red} </style> ``` - ##### 3.2常用选择器 ``` //HTML <p class="one" id="two">hello world</p> ``` ``` // css // 元素选择器 p{} // class选择器 .one{} // id选择器 #two{} ``` - ##### 3.3盒子模型 ![image.png](https://upload-images.jianshu.io/upload_images/12767105-c87442c46632831e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) - ##### 3.4实现元素水平居中 ``` // 元素水平居中仅对块元素有效 // 四位的话 上 右 下 左 顺时针 margin: 0 auto; // 上下 左右 ``` - ##### 3.5常用的css样式 ``` color: 设置文字的颜色 width: 设置一个元素的宽度 height: 设置一个元素的高度 background-color: 设置背景颜色 background-image: 设置一个元素的背景图片 line-height: 设置文字的行高 text-align: 设置文字的对齐方式 border: 设置边框的样式 ```