无需离开 VS Code,即可在编写 HTML 文件时实现“源码”与“预览”的无缝双向联动:
Write HTML inside VS Code with a fluid, bi-directional live sync preview:
源码 → 预览 (Code to Preview):在编辑器中移动光标或选中标签,右侧预览面板自动高亮对应的渲染元素并滚动至可视区域。
Moving the editor cursor automatically highlights the corresponding preview element and scrolls it into view.
预览 → 源码 (Preview to Code):点击预览面板中的任意渲染元素,左侧编辑器光标瞬间定位并滚动至该元素对应的确切代码行。
Clicking any rendered element in the preview panel instantly jumps the editor cursor to its exact line of code.
⚡ 核心特性 / Key Features
双向联动同步 (Bi-directional Syncing):代码光标移动与预览高亮元素互相同步,告别在大量 HTML 代码中肉眼寻找对应节点的痛苦。
点击编辑器右上角标题栏的 Hylo 预览图标(或按下 Cmd+Shift+P / Ctrl+Shift+P 打开命令面板,输入 Hylo: Open HTML Preview)。
Click the Hylo Preview Icon in the top-right title bar of the editor (or open the Command Palette and type Hylo: Open HTML Preview).
在左侧编辑源码,在右侧实时双向交互!
Edit code on the left, interact with live preview on the right!
💡 常见问题与提示 / FAQ & Tips
1. 为什么预览区没有渲染我的 CSS 样式?/ Why is my custom CSS not rendering?
为了防止用户代码污染编辑器,预览面板运行在沙盒化的 Shadow DOM 中。要想让预览区渲染样式,请确保在您的 HTML 文件中: