How To View the HTML Source in Google Chrome

Whether you are new to the web industry or a seasoned veteran, viewing the HTML source of different web pages is something you are likely to do many times over the course of your career.

For those new to web design and looking to learn, viewing a site‘s source code is one of the easiest ways to get started down that path. If you see something on a website and want to know how it was done, viewing the source is one way to do so.

Over the years, many web professionals have learned HTML simply by viewing the source of the web pages that they saw and were intrigued by. In addition to reading web design books or attending professional conferences, viewing a site‘s source code is a great way for beginners to learn HTML.

MORE THAN JUST HTML

One thing to remember is that source files can be very complicated (and the more complex the website you are viewing is, the more complex that site‘s code is likely to be). In addition to the HTML structure that makes up the page you are viewing, there will also be CSS (cascading style sheets) that dictate the visual appearance of that site as well as script files included along with the HTML. Don’t get frustrated if you can’t figure out what’s going on with that site immediately. Viewing the HTML source is just the first step in this process. With a little experience, you will begin to better understand how all these pieces fit together to create the website that you see in your browser.

STEP BY STEP INSTRUCTIONS

  1. Open the Google Chrome web browser (if you do not have Google Chrome installed, this is a free download)
  2. Navigate to the web page you would like to examine
  3. Right click the page and look at the menu that appears. From that menu, click "View page source".
  4. The source code for that page will now appear
  1. Alternatively, you can also use the keyboard shortcuts of CTRL + U on a PC to open a window with a site‘s source code displayed. On a Mac, this shortcut is Command + Alt + U.

DEVELOPER TOOLS

In addition to the simple "View page source" ability that Google Chrome offers, you can also take advantage of their excellent Developer Tools to dig even deeper into a site. These tools will allow you to not only see the HTML, but also the CSS that applies to view elements in that HTML document.

To use Chrome‘s developer tools:

  1. Open Google Chrome
  2. Navigate to the web page you would like to examine
  3. Click the icon with three lines in the upper right corner of the browser window
  4. From the menu, hover over "More tools" and then click "Developer tools"
  5. This will open a window that show the HTML source code on the left of the pane and the related CSS on the right.
  6. Alternatively, if you right click an element in a web page and select "Inspect" from the menu that appears, Chrome‘s developer tools will pop up and the exact element you have selected will be highlighted in the HTML with the corresponding CSS shown to the right.

IS VIEWING SOURCE CODE LEGAL?

Over the years, I have had many new web designers question whether it is acceptable to view a site‘s source code and use it in their education and work.

While copying a site‘s code wholesale and passing it off as your own on a site is certainly not acceptable, using that code as a springboard to learn from is actually how many advancements are made in this industry. In fact, you would be hard pressed to find a working web professional today who has not learned something by viewing a site‘s source!

In the end, web professionals learn from each other and often improve upon the work that they see and are inspired by, so do not hesitate to view a site‘s source code and use it as a learning tool.

(From thoughtgo)

时间: 2024-11-10 04:46:44

How To View the HTML Source in Google Chrome的相关文章

source.android.google && developer.android.google

https://source.android.google.cn/ https://developer.android.google.cn/ android源代码各个版本在线查看网址 http://androidxref.com/ https://www.androidos.net.cn/ https://www.androidos.net.cn/sourcecode  不错 https://github.com/aosp-mirror  不错 https://github.com/aosp-m

Google Chrome Source Code Download)

Google Chrome 源码下载地址 (Google Chrome Source Code Download) 地址: http://www.xiaohui.com/dev/vccool/internet/google-chrome-source-code-download.htm 1. Google Chrome 源码 SVN 地址:http://src.chromium.org/svn.包含有 Chrome.Gears.Webkit.GCC 等源码以及编译依赖工具.Chrome 浏览器项

使用View为Data Source的Form开发要点

(Data Source为View) 要点一:创建View的SQL语法 View的SQL里必须指定Form里唯一一个对其新增.修改.删除的基本表及其主键,其它表为辅助信息表,其字段仅用来在Form里显示.如下例: NCINV_SUB_PERSON_HEADERS 为基本表,主键为HEADER_ID PER_PEOPLE_F 为辅助表 要点二:Form里的Block属性设置 Database属性集的Query Database Source Name属性为视图名,如:NCINV_SUB_PERSO

Google Chrome抓包分析详解

Google Chrome抓包分析详解 一:什么是抓包 即抓取我们本地电脑与远端服务器通信时候所传递的数据包 二:Chrome浏览器讲解 Chrome 开发者工具是一套内置于Google Chrome中的Web开发和调试工具,可用来对网站进行迭代.调试和分析 三:打开Chrome开发者工具 在Chrome界面按F12 or在页面元素上右键点击,选择“检查” 四:开发者工具的结构 Elements(元素面板):使用“元素”面板可以通过自由操纵DOM和CSS来重演您网站的布局和设计. Console

How to install 64-bit Google Chrome 28+ on 64-bit RHEL/CentOS 6 or 7

How to install 64-bit Google Chrome 28+ on 64-bit RHEL/CentOS 6 or 7 The problem Google developers seem to think that Red Hat Enterprise Linux 6 - aka RHEL 6 - and its free equivalents (e.g. CentOS 6 and Scientific Linux 6) are no longer worth suppor

Google Chrome Browser源代码

Google Chrome 浏览器使用的内核源码来自开源浏览器引擎 WebKit Open Source Project.Google Chrome 的源码,同样亦是开源的.在 Google 的中文官方Blog - Google 黑板报中,提到: 我们对很多开发开源项目的人心存感激,我们承诺会沿着前人的路继续前行. 我们借鉴了一些源自 AppleWebKit 和 Mozilla Firefox 的技术,怀着同样开源的精神,Google浏览器所有的代码全部开源.我们希望能与整个业界合作从而促进互联

Google Chrome七大新特性

Google Chrome 在日常生活中扮演的角色不只是一个功能强大的网络浏览器,它内置的 DevTools 同样也是网络开发者进行网络开发的重要工具. DevTools 在不断的进行版本更新,其中有很多重要的更新细节你可能会错过.在这里罗列了 Google Chrome 最值得关注的七大新特性. 开始——Chrome 的 DevTools Experiment Chrome 有一些非常棒的实验性特性,这些特性在默认情况下都是隐藏和禁用的.在浏览器地址栏输入chrome://flags/#ena

Google Chrome开发者工具基本使用方法

最近在用pomelo开发游戏的服务端,发现每添加一条协议都要重新运行游戏特别麻烦,就自己动手谢了一个网页的客户端,来调试协议,主要用到的工具Google Chrome浏览器的开发者工具. 一 打开方式 F12 Ctrl+Shift+b/i/j 二 主要窗口 1 Console js代码中使用console.debug/console.log输出的信息,会显示在这里. 2 Resource 可以查看web程序跑起来后所加载的一些资源(Resources),包括图片或者其他"值",以及Co

Google Chrome插件开发-Context Menus

本节主要介绍如何在Google Chrome浏览器web页面上点击右键弹出自定义菜单,即如何使用谷歌Context Menus API接口.上节已经把主要流程介绍了,这节就直接上代码,代码都是官方例子没有实际意义,但是可以起到抛砖引玉的作用,大家根据自己的需要开发出自己想要的功能才是王道. manifest.json代码如下: { "name": "Context Menus Sample", "description": "Shows