The websites you visit and view has source code underneath that manages the menu, text, headings, images and all the data that is displayed on a webpage. This HTML source code manages the display and overall look of the webpages you visit. You can view the source code of any website on your Mac as well as on your iPhone. Source code can easily be seen in any of the web browser. Here we are going to discuss how to open the source code in Safari.
View Source Code in Safari
The first step in viewing the source code is enabling the Develop Mode in Safari. It hidden by default as this mode is normally not required and only developers know how to work with these options. But just viewing the HTML code doesn’t mean you are modifying the code therefore you can view it anytime. To enable the Develop mode you have to,
- Open your web browser i.e. Safari.
- Go to the Preferences from menu bar.
- Go to the Advanced
- Check the box at the end with the option ‘Show develop menu in menu bar’.
- Develop tab can now be seen in the menu bar.
Use Develop to View Source Code
- Now go to the menu bar and click on Develop.
- Choose ‘Show Page Source’.
View Source Code from Right Click
- To view a source code, open a webpage in Safari
- Right Click on the page and select ‘Show Source Page’.
Short cut keys to View Source Code
You can also see source code by using shortcut keys. The key combination for viewing the source code is Option/Alt+Command+U keys. Press all these keys simultaneously and you will see source code.
All these above methods open the source code of the webpage in new tab. You can go to the page and view the source code here.
View Source Code in iOS
To view source code from your iPhone you have to,
how to view source code on machow to view source code on mac
- Open a webpage in Safari from your iPhone, Bookmark this page and name it ‘View Source’.
- Now tap on the Bookmark on your browser and click Edit on the right.
- Click the ‘View Source’ bookmark you created above.
Now whenever you want to view a source code of any website, open the page in Safari. Go to the bookmarks and open View Source bookmark. It will open a new tab with the highlighted source code.