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>

使用

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

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

效果

相关推荐
南境十里·墨染春水1 小时前
C++ 工厂模式:从入门到进阶,彻底掌握对象创建的艺术
开发语言·c++·算法
yuanyxh1 小时前
Mac 软件推荐
前端·javascript·程序员
万少1 小时前
AtomCode开发微信小程序《谁去呀》 全流程
前端·javascript·后端
某人辛木1 小时前
Web自动化测试
前端·python·pycharm·pytest
Kagol2 小时前
Superpowers GSD gstack AgentSkills深度测评
前端·人工智能
JosieBook2 小时前
【数据库】时序预测能力的分级进化:TimechoAI如何让每一类用户都能精准预见未来
java·开发语言·数据库
加号32 小时前
【C#】 文件与目录管理:创建、删除操作的技术解析
开发语言·c#
excel3 小时前
JavaScript 字符串与模板字面量:从表象到本质理解
前端
diving deep3 小时前
脚本速览-python
开发语言·python
京东云开发者3 小时前
当AI成为导演-如何用AI创作动漫短剧
前端