这是第一个段落。哈哈,我还不知道要写些什么要好,要开始学习网页制作了,很开心。就先写这些吧。
这是一个无序列表:
我要添加链接了,先添加一个bing的网站链接吧。Bing搜索引擎
第一网站的学习先到这里结束了
下面这个按钮可以更改用户名:
这是一个有title的链接:百度搜索引擎
这是一个没有title的链接:Mozilla Developer Network
注释:<!-- 输入注释内容 -->。
注释内容不会显示在网页上,这里使用特殊字符的输入方法来写尖括号,所以不是注释,会显示在网页上,在实际注释的时候直接打尖括号就行了
今天没有学习网页技术,学习了git的使用方法,这样我就能再vscode里直接推送文件到仓库里,就不用打开网页更新文件了,那样很麻烦的。
第一次使用git,就是在官网上下载下来git软件,然后就能在github里面使用了
git init,完成 Git 的初始化,这会创建一个不可见的 .git 文件夹。git remote add origin "github仓库的网址.git"。这里的 origin 是云端仓库地址的别名(为了方便以后不用输长网址)。(PS:使用 GitHub CLI 工具的 gh repo create 命令可以直接在终端创建云端仓库。但是我还没有实践过)git add . 可以把所有改动过的文件添加到暂存区;如果只想添加指定文件,就输入 git add "文件名"。git commit -m "你的提交说明信息"。git push -u origin main 推送文件。-u 的作用是建立本地和云端的默认链接,以后推送只需输入 git push 即可。git pull origin main 拉取云端文件(有时可能需要加 --allow-unrelated-histories,就是git记录的版本历史不同,一般第一次拉取的时候加上就行),解决冲突之后,再次 add、commit,最后 push 即可。上面只是第一建立仓库的步骤,每个命令后面的还能加不同的命令内容,有不同的含义,这部分就留到明天来写吧
今天也是学习了git的使用方法,先讲一下git中产生的一些困惑,然后再讲解一下git的一些命令
终极解决方案:放弃手动配置 Git 代理,直接开启代理软件的 “TUN 模式”(虚拟网卡模式)。
1. 清空旧设置:在终端运行以下命令让 Git 恢复白纸状态:
git config --global --unset http.proxy
git config --global --unset https.proxy
2. 开启 TUN:在代理软件(如 Clash)中打开 TUN 总开关(网络栈选 gvisor,开启 DNS 劫持,关闭严格路由)。
3. 享受丝滑:此时代理软件会在底层接管电脑所有流量,Git 就能自动、顺畅地连网了,再也不用管端口配置!
解决方案:分批次“结账”。
1. 添加并提交第一个文件:
git add 文件A.html
git commit -m "更新了A的标题"
2. 添加并提交第二个文件:
git add 文件B.css
git commit -m "修改了B的颜色"
3. 最后一次性推送:git push
概念梳理:“传出的更改”说明你已经 Commit 了,但还没 Push 到云端(货已打包,等待发车)。
解决方案(对付乱报警的空格):
方法 1(撤销):在 VS Code 源码管理里,点击文件旁边的“放弃更改”箭头,抹除这个空格。
方法 2(一劳永逸):在 VS Code 设置中搜索并勾选 Trim Trailing Whitespace,保存时自动删掉多余空格。
核心概念:Git 不是普通的云盘,它是“时间线连环画”。
解答:它会把这两个 Commit 连带历史一起推送到云端。云端不仅会显示最新的文件状态,还会保留你这两次修改的完整历史记录,方便以后随时“时光倒流”。(程序员黄金法则:小步快跑,频繁 Commit 是好习惯!)
核心概念(三树架构):
🌳 工作区:你的实际文件(你能看见的 HTML、CSS)。
🌳 暂存区:虚拟的取景器(git add 的地方)。
🌳 本地仓库:隐藏的 .git 文件夹(git commit 存放的地方)。这里存的是高度压缩的版本快照,它是你项目的“历史保险箱”。
生存法则:无 Commit,不 Pull。
解答:只要你在 Pull 之前,把本地的代码执行了 git commit(存进保险箱),你的代码就绝对不会丢!
如果没改同一行,Git 会自动完美融合;如果改了同一行(产生冲突),Git 会立刻停下来,在 VS Code 里把双方的代码都显示出来,让你通过点击按钮亲自决定保留哪个。
origin/main)git branch -m 旧名 新名git branch -u origin/devgit pushgit push origin --delete devgit commit -m "信息"git add -u)Today, I want to document what I've learned in English.
I've learned about the <head> tag and some of its most common elements.
<head> Elements (Tags)<title> You use this tag like this: <title>My Page Title</title>. It defines the title of the page, which is what you see on the browser tab.
<meta> It uses various attributes to define the page's metadata.
charset attribute to define the character encoding. It is very important and must be included. You use it like this: <meta charset="UTF-8">. You can also set charset to other encodings.name and content attributes to communicate with search engines. When you search for something online, you see a short description below the website link. This is exactly what this attribute does! Example: <meta name="description" content="This is my page description.">. You can also use other names like "keywords" or "author".<link> This is an important tag used to link external resources. It has two basic attributes: rel and href. The rel attribute specifies the relationship between the document and the resource. The href attribute is the path (relative or absolute URL). Common rel values include:
stylesheet for CSS files.icon for favicon files.preload for preloading resources (like fonts or pictures).<link rel="stylesheet" href="path/styles.css">.
<script> This tag is used to include JavaScript code. It has two important attributes: src (to specify the file path) and defer (to delay execution until the HTML is fully parsed). Here are two ways to use it:
<head> section, it must have the defer attribute: <script src="path/script.js" defer></script><body> section, it must be placed at the very bottom, right before the closing </body> tag: <script src="path/script.js"></script>