When a page has several stylesheets, finding the rule in the browser is only half the job. You also need to locate the correct local file. This Dreamweaver tip connects those two steps: identify the stylesheet, search your project, then jump to the relevant code.
Start with the stylesheet path
Inspect the element in your browser’s developer tools and note the stylesheet associated with the rule you want to investigate. Keep the folder path as well as the filename: a WordPress project can contain similarly named files in different themes and plugins.
Work with a local copy of the correct project. A filename match alone is not proof that you have found the file used by the page.
Use Live Search on Mac
The Files-panel search described in the original tip is Dreamweaver’s Mac Live Search feature. Adobe’s Live Search guide explains that it searches filenames and file contents within the selected site’s local root folder.
- Select the intended site in the Files panel; without a selected site, this search option does not appear.
- Enter a distinctive filename or piece of text in the Live Search field.
- Check the result’s path before opening it, especially when several files share a name.
If that field is unavailable in your setup, locate the filename within your project’s folder using your operating system’s file search. To search the code inside files, use the following Dreamweaver command.
Search code across your local site
Choose Find > Find and Replace in Files. Enter a distinctive selector or text fragment, then choose the scope deliberately: a folder, selected site files or the entire current local site. Select Find All to inspect matches before considering any replacement.
Double-click a result to open its location. Adobe’s find-and-replace guide explains the available scopes and filters. For a literal CSS selector, check that regular-expression matching is not enabled unintentionally.
Jump to the line and verify the match
With the correct file open, use Command + comma on Mac or Ctrl + G on Windows for Go to Line, as listed in Adobe’s default keyboard shortcuts. Enter the line number from your inspection.
Compare the selector and surrounding code before editing. If the browser is showing a generated or compressed stylesheet, or your local copy differs from the deployed version, the same line number may not identify the same rule. Search for the selector and establish which source file should be changed.
Keep a recoverable copy, make a focused change and test it in a local or staging preview. Check the intended element at different screen widths before publishing through your project’s normal workflow.
Build this skill: finding and editing website code
Tell Academy Class about your HTML, CSS and website-editing goals so our team can discuss suitable training options with you.