卓越的文本2编辑器支持实时HTML和CSS预览吗?

时间:2022-01-13 02:59:21

Does the Sublime Text 2 editor support real time HTML & CSS preview?

卓越的文本2编辑器支持实时HTML和CSS预览吗?

2 个解决方案

#1


41  

There's a package for this: Browser Refresh by Giovanni Collazo. It supports OS X and Windows 7, and all major browsers.
You can install it via Package Control (or manually) and trigger it with super+shift+r in Sublime Text 2.

这里有一个包:Giovanni Collazo的浏览器刷新。它支持OS X和Windows 7,以及所有主要的浏览器。您可以通过包控制(或手动)安装它,并使用super+shift+r在Sublime Text 2中触发它。

I haven't tested it personally since I use CodeKit for this functionality, but it seems popular.

我没有亲自测试过它,因为我使用CodeKit来实现这个功能,但它似乎很受欢迎。


Update:

Windows XP-compatible software

Windows xp软件

  • LiveReload (Windows version is pre-alpha) - there is also a supporting Sublime Text 2 package
  • LiveReload (Windows版是pre-alpha版)——还有一个支持崇高的文本2包
  • XRefresh - deprecated version of LiveReload (worth mentioning for stable XP compatibility)
  • XRefresh -弃用的LiveReload版本(对于稳定的XP兼容性值得一提)
  • AutoHotKey - example
  • AutoHotKey——示例
  • VBS script - triggered by a keyboard shortcut
  • 由键盘快捷键触发的VBS脚本。

Chrome extensions

Chrome扩展

Firefox addons

火狐浏览器插件

IE addons

IE插件


Note: Browser extensions will refresh at regular intervals, not when you save a file.

注意:浏览器扩展将定期刷新,而不是在保存文件时刷新。

#2


0  

I have found the easiest way to use Sublime with live HTML and CSS is to install WAMP(www.wampserver.com/en/) or XAMPP(www.apachefriends.org/en/xampp.html) which installs an Apache web server, PHP and Mysql server on your computer. Then you can edit your files in Sublime, and so long as they are located within the Apache web root folder (i believe its wamp/htdocs or xampp/htdocs) then you can go to localhost//filename.html and there is your html files. Save in Sublime and refresh the page and there are your changes.

我发现,在实时HTML和CSS中使用Sublime的最简单方法是在计算机上安装WAMP(www.wampserver.com/en/)或XAMPP(www.apachefriends.org/en/xampp.html),在计算机上安装Apache web服务器、PHP和Mysql服务器。然后你可以编辑你的文件,只要它们位于Apache web根文件夹中(我相信它的wamp/htdocs或xampp/htdocs),你就可以访问localhost// /filename。这是你的html文件。保存到崇高和刷新页面,这是你的改变。

You can also just open up the html file in Chrome or Firefox but selecting Open With... however, i have found that sometimes if you have dynamic content or links, they might not work correctly.

您也可以在Chrome或Firefox中打开html文件,但是选择open With…然而,我发现,有时候如果你有动态的内容或链接,它们可能无法正常工作。

#1


41  

There's a package for this: Browser Refresh by Giovanni Collazo. It supports OS X and Windows 7, and all major browsers.
You can install it via Package Control (or manually) and trigger it with super+shift+r in Sublime Text 2.

这里有一个包:Giovanni Collazo的浏览器刷新。它支持OS X和Windows 7,以及所有主要的浏览器。您可以通过包控制(或手动)安装它,并使用super+shift+r在Sublime Text 2中触发它。

I haven't tested it personally since I use CodeKit for this functionality, but it seems popular.

我没有亲自测试过它,因为我使用CodeKit来实现这个功能,但它似乎很受欢迎。


Update:

Windows XP-compatible software

Windows xp软件

  • LiveReload (Windows version is pre-alpha) - there is also a supporting Sublime Text 2 package
  • LiveReload (Windows版是pre-alpha版)——还有一个支持崇高的文本2包
  • XRefresh - deprecated version of LiveReload (worth mentioning for stable XP compatibility)
  • XRefresh -弃用的LiveReload版本(对于稳定的XP兼容性值得一提)
  • AutoHotKey - example
  • AutoHotKey——示例
  • VBS script - triggered by a keyboard shortcut
  • 由键盘快捷键触发的VBS脚本。

Chrome extensions

Chrome扩展

Firefox addons

火狐浏览器插件

IE addons

IE插件


Note: Browser extensions will refresh at regular intervals, not when you save a file.

注意:浏览器扩展将定期刷新,而不是在保存文件时刷新。

#2


0  

I have found the easiest way to use Sublime with live HTML and CSS is to install WAMP(www.wampserver.com/en/) or XAMPP(www.apachefriends.org/en/xampp.html) which installs an Apache web server, PHP and Mysql server on your computer. Then you can edit your files in Sublime, and so long as they are located within the Apache web root folder (i believe its wamp/htdocs or xampp/htdocs) then you can go to localhost//filename.html and there is your html files. Save in Sublime and refresh the page and there are your changes.

我发现,在实时HTML和CSS中使用Sublime的最简单方法是在计算机上安装WAMP(www.wampserver.com/en/)或XAMPP(www.apachefriends.org/en/xampp.html),在计算机上安装Apache web服务器、PHP和Mysql服务器。然后你可以编辑你的文件,只要它们位于Apache web根文件夹中(我相信它的wamp/htdocs或xampp/htdocs),你就可以访问localhost// /filename。这是你的html文件。保存到崇高和刷新页面,这是你的改变。

You can also just open up the html file in Chrome or Firefox but selecting Open With... however, i have found that sometimes if you have dynamic content or links, they might not work correctly.

您也可以在Chrome或Firefox中打开html文件,但是选择open With…然而,我发现,有时候如果你有动态的内容或链接,它们可能无法正常工作。