1. Computing

Discuss in my forum

How To View the HTML Source in Safari

By

Viewing the HTML source of a web page is one of the easiest ways to learn HTML. If you see something on a website, and want to know how they did it, view the source. Or if you just like their layout, view the source. I learned a lot of HTML simply by viewing the source of web pages that I saw. It’s a great way for beginners to learn HTML.

But remember that source files can be very complicated. There will probably be a lot of CSS and script files along with the HTML, so don’t get frustrated if you can’t figure out what’s going on immediately. Viewing the HTML source is just the first step. After that you can use tools like Chris Pederick’s Web Developer extension to look at the CSS and scripts as well as inspect specific elements of the HTML.

Difficulty: Easy

Time Required: 1 minute

Here's How:

  1. Open Safari
  2. Navigate to the web page you would like to examine
  3. Click on the “Develop” menu in the top menubar
  4. If the Develop menu is not visible, go into Preferences in the Advanced section and select “Show Develop menu in menu bar.”
  5. Click on “Show Page Source”
    This will open a text window with the HTML source of the page you’re looking at.

Tips:

  1. On most web pages you can also view the source by right-clicking on the page (not on an image) and choosing “Show Page Source.” This will only display if the Develop menu is enabled in Preferences.
  2. Safari also has a keyboard shortcut for viewing the HTML source — hold down the command and option keys and hit u — Cmd-Opt-U.

What You Need

  • Safari
  1. About.com
  2. Computing
  3. Web Design / HTML
  4. Testing Your Web Pages
  5. Web Browsers
  6. Safari
  7. How To View the HTML Source in Safari

©2014 About.com. All rights reserved.