We often use the Find and Replace tool (CTRL + F) to search for words, in our context, tags, elements, properties and so on in our page. But the same dialog box offers a cool feature of setting HTML rules in your search. These HTML rules let you add conditions as to where in your code to search. Let us take a look at how that can be done.
Follow these steps to set HTML rules for searching –
- Do either of the following
- To search within a single page, open the page.
- To search the entire site, open the site.
- To search more than one page in a website, open the site and in the Folder List panel or the Site View, select the pages. Else open all those pages you want to search.
- Go to the Edit menu and choose Find… to find text, and Replace… to replace text. Both would launch the same Find and Replace dialog box, with different tabs selected by default.
- Click on the ‘HTML Rules…’ button. The HTML Rules dialog box would be prompted.
- Click on ‘New rule…’ In the drop down box (left bottom corner of the window, choose to set the rule ‘Inside tag’ or ‘Not inside tag’. In either case, select a tag, from the other drop down. The rule would be created.
- To configure the rule, click on the ‘New rule…’ (appears as a child under the rule we created above, in the tree view). Choose the options in the bottom left corner for the rule. They are as follows:
a. With attribute: to search inside a tag with the given attribute. For example, inside tag <p>, search for only those tags that have attribute class = content_text.
b. Without attribute: to search inside a tag without the given attribute. For example, inside tag <p>, search for all other tags except for the ones with attribute class = content_text.
c. Containing: to search only if it is in another text or tag that you specify.
d. Not Containing: to search only if it is not another text or tag that you specify.
e. Inside Tag: to search only if it is in a tag that you specify.
f. Not Inside Tag: to search only if it is not in a tag that you specify.
- To delete a rule, choose ‘Delete rule’ and to delete all the rules, choose ‘Delete all’.
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