OldDew
OldDew

Reputation: 67

How do I add a selection between two tags in a html document using Visual Studio Code?

Let's say that I have the following html paragraph:
<p>This is a nice paragraph</p>

Is there a quick way to emphasise, for example, the word 'nice'?
If I write <em> before 'nice', my paragraph will look like this:
<p>This is a <em></em>nice paragraph</p>
Because of this, I have to copy 'nice' and paste it between the two <em> tags and I feel that it would be time consuming over a long period.
Is there a way to select the word 'nice' and then write <em> to instantly get it between the tags, and not to get it replaced by the tags?

Upvotes: 1

Views: 738

Answers (1)

Soban
Soban

Reputation: 434

What you need is Embedded Emmet.

  1. In Visual Studio Code, press Ctrl + Shift + P (which opens Command Palette).
  2. Execute: Emmet: Wrap with Abbreviation
  3. Enter a tag e.g. div (or an abbreviation .wrapper>p)
  4. Press Enter

enter image description here

Hope it helps.

Upvotes: 1

Related Questions