A code snippet is a piece of code. If there is some code that you may need to use often, you can create a code snippet for that code. Microsoft Expression Web has few built-in code snippets that you can use as they are or you can modify them as per your requirement.
To create a code snippet:
- From the Tools menu choose Page Editor Options.
- In the Page Editor Options dialog box, switch to the Code Snippets tab and click Add.
- In the Add Code Snippet dialog box, fill out the following fields:
- Keyword: Type a unique word that describes the code snippet, its function. This would help you locate the code snippet from the list of code snippets.
- Description: A description of the code snippet.
- Text: Type in the text that is to be displayed by the code snippet.
- When done click OK and the newly created code snippet will be added to the existing list of snippets.
To insert a code snippet in a page
Follow these steps:
- In Code View or Split View of your page, place the cursor where you want to add the code snippet and do one of the following:
- Key in CTRL + Enter.
- Go to Edit menu > Intellisense > Code Snippets.
- Display the Code View toolbar (Right click on any toolbar and choose Code View) and select button (List Code Snippets button).
- In the displayed list of snippets, do one of the following:
- Scroll down to find your code snippet, hit enter, tab or double click on it.
- Type in the name of the snippet and once found, hit enter, tab or double click on it.
Filed Under: Expression Web
About the Author: Minal is a freelance web and graphics designer. She specializes in designing Logos, Stationery, Graphics and Icons as well as website templates using graphical tools like Photoshop, Illustrator and Expression Web. Twitter @saffronstroke