、、、
、-
-
通用属性:
CSS(层叠样式表)
selector {
property: value;
}
-
选择器:
-
元素、.class、#id、元素.class、元素#id
- 伪类::hover、:active、:focus
- 伪元素:::before, ::after
-
布局技巧:
.container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: row; /* or column */
}
.grid-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
}
-
定位:
-
盒子模型:
div {
margin: 10px;
padding: 20px;
border: 1px solid #000;
}
@media screen and (max-width: 768px) {
.container {
display: block;
}
}
JavaScript
let variable = "value"; // Mutable
const constant = "value"; // Immutable
function myFunction() {
console.log("Hello");
}
const myArrowFunction = () => console.log("Hello");
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Title</title>
</head>
<body>
<header></header>
<main></main>
<footer></footer>
</body>
</html>
-
数组方法:
-
映射(),过滤器(),减少(),forEach()
selector {
property: value;
}
React.js(基础)
.container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: row; /* or column */
}
.grid-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
}
div {
margin: 10px;
padding: 20px;
border: 1px solid #000;
}
@media screen and (max-width: 768px) {
.container {
display: block;
}
}
版本控制 (Git)
-
基本命令:
-
git init - 初始化存储库
-
git status - 检查当前状态
-
git 添加 . - 暂存所有更改
-
git commit -m "Message" - 提交更改
-
git push - 推送到远程存储库
-
git pull - 获取更新
常用工具
-
npm(节点包管理器)命令:
-
npm install ; - 安装软件包
-
npm start - 启动应用程序
-
代码格式化程序:
-
Prettier - 自动格式化代码
-
ESLint - 检查潜在错误