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>

使用

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

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

效果

相关推荐
JeffongTan7 小时前
在LWC中镶嵌VF Page获取用户IP
前端·javascript·salesforce
点心的游戏开发世界8 小时前
GDScript 入门笔记(十一):Lambda 与匿名函数
开发语言·笔记·游戏引擎·godot
陆枫Larry9 小时前
Astro 是什么
前端
事圆则缓10 小时前
Kotlin 协程完全指南
开发语言·kotlin
我爱写代码i10 小时前
BeLink - 支持生成多种URL 缩短网址PHP源码
开发语言·php·短网址php源码
Java后端的Ai之路10 小时前
20、Python - 备忘录模式
开发语言·人工智能·python·外观模式·备忘录模式
是立不是利11 小时前
写给设计师的 CSS 博客美学指南
前端·css
统计学小王子11 小时前
数学建模国赛倒计时4天——《统计模型精讲(混合效应模型R语言实现)》
开发语言·数学建模·r语言
知无不研11 小时前
c语言中循环的介绍与简单应用
c语言·开发语言·算法·循环·for·while
郝学胜-神的一滴11 小时前
Qt 高级编程 045:坐标体系深度实战
开发语言·c++·windows·python·qt·程序人生