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)

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

  1. Google Chrome 源码下载地址 (Google Chrome Source Code Download)

    1. Google Chrome 源码 SVN 地址:http://src.chromium.org/svn.包含有 Chrome.Gears.Webkit.GCC 等源码以及编译依赖工具.Chrom ...

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

    https://source.android.google.cn/ https://developer.android.google.cn/ https://source.android.com/co ...

  3. 【读书笔记】https://source.android.google.cn/devices/bootloader

    https://source.android.google.cn/devices/bootloader 本文主要记录aosp官网关于bootloader的相关资料 Bootloader A bootl ...

  4. CEF中文教程(google chrome浏览器控件) -- Windows下编译Chromium

    CEF中文教程(google chrome浏览器控件) -- CEF简介 2013-04-10 16:48 42928人阅读 评论(4) 收藏 举报  分类: CEF(2)    目录(?)[+]   ...

  5. 详解Google Chrome浏览器(操作篇)(一)

    开篇概述 在上篇博客中详解Google Chrome浏览器(理论篇)一文中,主要讲解了Chrome 搜索引擎使用.Chrome安装和基本操作.Chrome 基本架构.多线程等原理性问题,这篇将重点讲解 ...

  6. 详解Google Chrome浏览器(操作篇)(下)

    开篇概述 由于最近忙于公司产品的架构与研发,已经三个多月没有写博客了,收到有些朋友的来信,问为什么不及时更新博客内容呢,他们说他们正期待着某些内容.对此,非常抱歉,那么我在此也给各位朋友一些承诺,从即 ...

  7. 浅谈Google Chrome浏览器(操作篇)(上)

    开篇概述 在上篇博客中详解Google Chrome浏览器(理论篇)一文中,主要讲解了Chrome 搜索引擎使用.Chrome安装和基本操作.Chrome 基本架构.多线程等原理性问题,这篇将重点讲解 ...

  8. High Performance Networking in Google Chrome

    小结: 1. 小文件存储于一个文件中: 在内部,磁盘缓存(disk cache)实现了它自己的一组数据结构, 它们被存储在一个单独的缓存目录里.其中有索引文件(在浏览器启动时加载到内存中),数据文件( ...

  9. 【ASP.NET MVC系列】浅谈Google Chrome浏览器(操作篇)(下)

    ASP.NET MVC系列文章 [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操作 ...

随机推荐

  1. 惠普hp服务器通过iLO接口远程安装操作系统

    我们以hp proliant sl210t的机器为例,我们在配置好iLO接口的远程管理后,我们便可以通过iLO进行操作系统的安装 关于惠普服务器的iLO配置,可参笔者的另一篇文章<关于hp pr ...

  2. python nose测试框架全面介绍二

    二.基本使用 nosetest脚本的使用(在安装完nose之后) nosetests [options] [(optional) test files or directories] 我们可以使用配置 ...

  3. js的mime类型有哪些?

    js中的mime类型 常见类型 扩展名 类型/子类型 txt text/plain doc application/msword exe application/octet-stream pdf ap ...

  4. 'cmd' 不是内部或外部命令,也不是可运行的程序 或批处理文件.

    添加path内容: %SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;

  5. 大话FLASH和EEPROM

    最近在看代码的时候,遇到了一个使用FLASH模拟EEPROM的情况,看到这个我当时是一脸蒙蔽啊,对于一个有时候连FLASH和EEPROM都分不清的人来说,怎么可能读懂用FLASH来模拟EEPROM呢? ...

  6. Bagging和Boosting的概念与区别

    随机森林属于集成学习(ensemble learning)中的bagging算法,在集成算法中主要分为bagging算法与boosting算法, Bagging算法(套袋发) bagging的算法过程 ...

  7. 前端基础进阶之Promise

    前言 Promise的重要性我认为我没有必要多讲,概括起来说就是必须得掌握,而且还要掌握透彻.这篇文章的开头,主要跟大家分析一下,为什么会有Promise出现. 在实际的使用当中,有非常多的应用场景我 ...

  8. IIS 下载文件 报错“401 - 未授权: 由于凭据无效,访问被拒绝。”

    点开身份验证 改为启用就OK了 重启一下IIS. 如果你上在办法没有解决可参考 1.打开“IIS信息服务管理器”——>选择你发布的网站——>选择功能视图中的“身份验证”——>右键匿名 ...

  9. HDU 6312 - Game - [博弈][杭电2018多校赛2]

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6312 Problem Description Alice and Bob are playing a ...

  10. 2018牛客网暑期ACM多校训练营(第一场) J - Different Integers - [莫队算法]

    题目链接:https://www.nowcoder.com/acm/contest/139/J 题目描述  Given a sequence of integers a1, a2, ..., an a ...