HTML之VSCode简单配置与创建

目录

插件下载

然后输入源码:

使用

效果


插件下载

下载这个插件后可以直接运行:

然后创建一个文件:

然后输入源码:

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人博客</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f2f2f2;
        }
        header {
            background-color: #333;
            color: white;
            text-align: center;
            padding: 1rem;
        }
        nav {
            background-color: #444;
            color: white;
            text-align: center;
            padding: 0.5rem;
        }
        nav a {
            color: white;
            text-decoration: none;
            margin: 0 1rem;
        }
        .container {
            padding: 2rem;
            max-width: 800px;
            margin: 0 auto;
            background-color: white;
        }
        .post {
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid #ccc;
        }
        .post h2 {
            margin-top: 0;
        }
        .post p {
            color: #666;
        }
    </style>
</head>
<body>
    <header>
        <h1>欢迎来到xxx的个人博客</h1>
        <p>在这里分享你不可告人的秘密</p>
    </header>
    <nav>
        <a href="#home">首页</a>
        <a href="#blog">博客</a>
        <a href="#about">关于我</a>
        <a href="#contact">联系方式</a>
    </nav>
    <div class="container">
        <div class="post">
            <h2>一号博客</h2>
            <p>一号博客。</p>
        </div>
        <div class="post">
            <h2>二号博客</h2>
            <p>一号博客。</p>
        </div>
    </div>
    <footer>
        <p>&copy;阿巴阿巴</p>
    </footer>
</body>
</html>

使用

两种方法,一个是默认,直接打开:

另一种是自己选择哪个浏览器打开:

效果

相关推荐
名字还没想好☜7 小时前
Python f-string 进阶:数字格式化、对齐填充、调试 = 号与嵌套表达式
开发语言·数据库·python·字符串格式化·f-string
用户938515635077 小时前
从零在浏览器里跑 DeepSeek-R1:WebGPU + Transformer.js 全链路实战
前端·设计模式·typescript
CodeSheep8 小时前
稚晖君公司人事大变动,来了!
前端·后端·程序员
鱼樱前端8 小时前
用 AI 做内容变收入
前端·人工智能·ai编程
eric-sjq8 小时前
10 分钟实战:用 0.6B 本地模型生成中文网页(WanlyFrontend + 编译器全流程)
javascript·机器学习·自然语言处理·html
浮生望8 小时前
React + TypeScript 组件设计进阶:从类型约束到无状态组件的三次进化
前端
90后的晨仔9 小时前
Mac 开发 uni-app 终极方案:让安卓模拟器彻底脱离 Android Studio 独立运行
前端·vue.js
90后的晨仔9 小时前
别再搞混了!uni-app 中 node_modules 和 uni_modules 到底是什么关系?
前端
kyriewen9 小时前
面试官问"这段逻辑为什么这样写"——我才发现,这半年我写的代码,我自己都解释不了
前端·javascript·面试
谢小飞10 小时前
大文件上传很难?学会这招,GB文件秒传不是梦
前端·node.js