如何在 VS 2008 中用 HTML 标记快速包围文本?

发布于 2024-07-13 09:00:17 字数 179 浏览 6 评论 0原文

我正在使用 Visual Studio 2008 编辑器。 有没有办法以一段文本为例,突出显示它并使用快捷方式快速添加标记?
例如,假设我有一条文本,我去了:the store并且我想将其加粗,我必须输入the store。 有没有更快、更简单的方法来做到这一点?

I am working with Visual Studio 2008 editor. Is there a way to take a piece of text for example, highlight it and use shortcuts to quickly add markup?
For example, lets say I have a text, I went to: the store and I want to bold it, I have to type <b>the store</b>. Is there a quicker and easier way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

醉殇 2024-07-20 09:00:17

选择文本,Ctrl+X,输入将由 vs 自动关闭的标签,Ctrl+V

Select text, Ctrl+X, type in your tags which will be autoclosed by vs, Ctrl+V

妳是的陽光 2024-07-20 09:00:17

使用 HTML 编辑器只需按 Ctrl+B...

使用常规文本编辑器 VS 不提供内置功能,但您可以添加自定义宏。 像下面这样的东西会为你做工作。

Sub MakeSelectionBold()
    DTE.ActiveDocument.Selection.Text = "<b>" + DTE.ActiveDocument.Selection.Text + "</b>"
End Sub

然后,您可以将其分配给快捷方式或将按钮添加到工具栏。

With HTML Editor just press Ctrl+B...

With regular text editor VS does not provide something build-in, but you can add custom macros. Something like the following will do job for you.

Sub MakeSelectionBold()
    DTE.ActiveDocument.Selection.Text = "<b>" + DTE.ActiveDocument.Selection.Text + "</b>"
End Sub

You can then assign it to the short-cut or add button to your toolbar.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文