Home >Web Front-end >HTML Tutorial >Share four ways to view the source code of a page

Share four ways to view the source code of a page

yulia
yuliaOriginal
2018-09-20 14:43:47100753browse

When front-end developers encounter a web page they like when browsing the web, they always want to see how the code is written. Some people also need to modify the source code of the web page. Do you know how to view the source code of a web page? ? This article will tell you how to view source code, as well as shortcut keys for viewing source code in different browsers. Friends in need can refer to it, I hope it will be useful to you.

1. What is the source code?

Generally speaking, the code that allows images, text, videos and other content to be displayed in the browser through html code, we Just call it the web page source code. CSS code can be called CSS source code.

2. How to view the source code

The following mainly introduces four methods to open the web page source code

1. Open any web page, right-click Click and you will see "View Source Code", and the source code of this web page will appear in front of you.

Share four ways to view the source code of a page

#2. For convenience, friends can use the shortcut Ctrl U to view the source code, which can also be achieved.

Supplement: If you want to see the partial style of a page, you can right-click the mouse and click Inspect Element. You can also use the shortcut key F12 or the shortcut key Ctrl Shift I to call or close the developer tools to view the source code.

3. You can also add view-source:

in front of the address bar of the webpage you want to view. For example: view-source:https://www.baidu.com/ You can view Baidu's source code

Share four ways to view the source code of a page

4. In addition, you can also find "More Tools" in the browser's settings menu box, and then look for development tool, you can also view the source code of the web page.

Note: However, different browsers seem to be slightly different.

Firefox: Find the settings menu box, find the web developer, and then find the page source code

火狐Share four ways to view the source code of a page

Google Chrome will not take screenshots one by one. Pretty much the same, with just a few slight differences.

The above introduces four methods to view the source code of the page. Friends who don’t know can try it themselves and find a convenient and easy-to-use method.

The above is the detailed content of Share four ways to view the source code of a page. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn