Key facts

  • How to view page code in Safari: a practical step-by-step guide from iNevidimka Blog.
  • From the top menu, select Safari > Preferences.
  • At the bottom of the window, check the box next to "Show features for web developers.".

Apple Safari is known for speed and efficiency, but it also includes useful tools for developers and curious users. This guide shows how to enable the developer features and inspect the HTML, CSS, and JavaScript of a page in Safari on a Mac.

Step 1: Enable Developer Menu in Safari

Before you begin, you need to activate the "Development" menu. To do this:

  1. Launch Safari.
  2. From the top menu, select Safari > Preferences.
  3. Go to the Advanced tab.
  4. At the bottom of the window, check the box next to "Show features for web developers."

Step 2: View the page source code

Now that you have access to the developer menu:

  1. Open the web page you are interested in.
  2. In the menu bar, select Click on "Show page source code" or use the keyboard shortcut ⌥⌘U.

In the window that opens, you will see the full source code of the page. You will be able to see the HTML structure, CSS styles, and JavaScript scripts.

Alternative methods

Additionally, you can right-click any element on the page and select “Inspect Element.” This will open the developer tools directly in the context of the selected element, allowing you to analyze and modify the HTML and CSS in real time.

Using Safari's View Source feature is a great way for developers and curious users to explore web pages, understand how sites are built, and even help teach web development. Remember, changes made through the developer tools are local only and do not affect the actual site.