Open source code page hotkeys. How to open the source code of a page

1 vote

Good day, dear readers of my blog. Sometimes you find some beautiful feature on a website and begin to wonder how the creator achieved such an interesting effect.

It turns out that the answer is quite simple. And if you have some skills, you can collect a lot of these features and create your own unique website in a short time.

Today we will talk about how to open the page code, specific element and learn to use this skill to your advantage.

Basic knowledge of code

My site is intended for beginners and first I would like to briefly talk about sites and code in general.

To draw a picture, then cut it into small parts, write code so that the browser will reassemble all the elements into a single whole. Does everything seem very complicated? Not at all, and there’s no point in grieving about it.

This is how high-quality websites are created. If you want, get involved in this matter and study it; if you don’t want to, no one can force you.

I will only say one thing... there is nothing more pleasant than seeing how incomprehensible words you wrote are transformed into a single whole and come to life: links work, buttons move, pictures move, text crawls. I think I know how Victor Frankenstein felt.

When you begin to comprehend the secret language and see that everything is actually much simpler than it seemed initially, you cannot help but believe in own strength and brain capabilities. This is very cool.

How are websites made? Ideally, first. He's just painting a picture. For example, as shown in the picture below. For now it is just an image, a photograph. No links work, when you click you don’t go anywhere, no search is carried out.

According to this drawing. Look at the screenshot below. You may think that this is ridiculous and very complex set characters. In fact, everything is not so complicated, there is a certain algorithm.

There are only about 150 tags and each of them is responsible for a specific action: link, hyphenation, bold, color, title, and so on. Understanding them is not so difficult if you have the desire and don’t mind the time.

Thanks to knowledge of these attributes, you can solve almost any problem. But each developer finds his own ways to achieve the goal.

Experienced creators immediately see how to achieve results, while others have to think, look for the answer in articles or in the source code of competitors. They simply take the necessary part from a third-party site and edit it for themselves. This significantly shortens the work process.

A little later, I will show you a specific example.

View code

So, let me first show you how to act if you need to find out someone else's html. Then we will look at all the other questions in more detail.

The best way

The method that I will describe first is a little complicated for beginners, but as an introduction, read it. Open the page and click on the right mouse button. Select “Save as...”

Save the entire web page. As you can see in the screenshot, I have already downloaded everything in advance. Here we have two folders.

Everything you need is here. Every element. If you understand this, you can quickly get everything you need. But such a task is increasingly becoming impossible. There is no downloading. What to do if it is prohibited to copy a page?

This is Google Chrome

As you may have already noticed, I most often use Google Chrome and learning someone else's code in this browser is as easy as shelling pears. As in principle with any other. The scheme will not only be similar, but identical. Open the page whose code we want to know and right-click anywhere. In the window that appears, click “View page code”.

A sheet of code will open in a new window, which is quite difficult for a beginner to understand. But don't be alarmed ahead of time.

If you need to know the code of only one element, just hover over it with the mouse and right-click. Select another Chrome function: “View element code”.

For example, I might be interested in how the logo was made, using a picture or a programming language? After all, you can draw a square with css help. Many experts advise how to more information write in code. How do they work on popular sites?

So it appeared necessary information. html on top, css on bottom. These are two languages. The first is responsible for the text component, and the second for the design. If there were no CSS, then you would have to specify the color and font size each time. For each page, this is very long. But if there were no html, then we would not have texts. I explained it roughly, but in general, that’s how it is.

By the way, if you are interested in how it works here, you can look at the link to the picture below. Here's your answer.

Mozilla Firefox

If you like to work in mastic, then everything will be exactly the same. Open the page and click on right button mice. “Page source code” if you want to see the entire code.

When you hover over an element, you can open its code.

Here the data is displayed at the bottom of the screen, but otherwise everything is exactly the same.

Yandex browser

In the Yandex browser everything is exactly the same as in the previous two options, open the page, right key mouse, look at the page code.

We hover the cursor over an element if we want to find out exactly its code.

Everything is displayed here exactly the same as in Chrome.

Opera

And finally, Opera.

By the way, you may have noticed that you don't have to use a mouse. To open the code there is quick combination keys and it is the same for all browsers: CTRL+U.

For elements: Ctrl+Shift+C.

This is what the result looks like.

This will be interesting for beginners

Now look how everything works. You find a site and really like some element. For example, this one. You already know how to open the element code.

Now copy it.

I use, paste this code into new html file, in the body tag (body in English).

Now let's see how it all will look in the browser.

Ready. In order for the text to be aligned to the edges and acquire a greenish color, you need to connect to this css document and copy another code from the site from which we stole this one.

I won't do this now. This requires more time: both mine and yours. I think that I will describe all the details in my future publications. Subscribe to the newsletter and be the first to know when an article appears.

If you can’t stand it, but want to learn more about html and css now, then I can traditionally recommend you free training courses.

Here are 33 lessons that will allow you to master html - « Free course by HTML" .

And here full information about css - “Free course on CSS (45 video lessons!)” .

Now you know a little more. I wish you success in your endeavors. See you again!

We released new book"Content marketing in in social networks: How to get into your subscribers’ heads and make them fall in love with your brand.”

Subscribe

The source code of the site is a combination of HTML markup, CSS styles and JavaScript scripts, which the browser receives from the web server.

More videos on our channel - learn internet marketing with SEMANTICA

It can be compared to a set of commands given to soldiers by a commander. Imagine that the audience does not see or hear the boss. From their point of view, the military carries out actions independently. In our case, the commander is the browser, the commands are source, and marching soldiers are the end result.

The site is stored on a web server, which sends the page upon user request. A request is typing a URL in the address bar, clicking a link, or clicking a submit button on a form. It doesn't matter what language the web pages are written in, whether they include software part. The end result of any server-side algorithm is a set of html tags and text.
The page source code is a set of data that includes:

  • html markup;
  • style sheet or file link;
  • programs written in JavaScript or links to files with code.

These three sections are processed by the browser. For the server, this is simply the text that needs to be sent in response to the request.

Why we might need to study the source code

Everything we see, we can analyze and apply to solve certain problems that arise while working with the site, especially when optimizing it. By looking at the source code, we can:

  • See the meta tags of your or someone else’s site to analyze them.
  • See the presence or absence of certain elements on the site: counters, identification codes in various systems, certain scripts and other things.
  • Find out the parameters of the elements: sizes, colors, fonts.
  • Find the path to photos and other elements located on the page.
  • Explore links from the page.
  • Find problems with the code that interfere with the process of website optimization: those not addressed in separate files styles, scripts, invalid code.

These are the basic features, but in fact, by being able to read the code, you can learn a lot more about the page.

How to view the source code of a site

It will not be possible to do this completely in the form in which it is posted on the server from the browser. But you can see all the markup by right-clicking on the page. Here and further on Google example Chrome.

Select the option “View page code” and get full listing in a separate tab.

It's just text that you have to analyze to understand. But get interactive code you can use the developer tools.

How to find the source code of a website page

Click on the menu icon in the browser. Most often it is on the right and looks like three dots or stripes.

In the additional tools section, select “Developer Tools”.

A window will open showing the active state of the code. This means that when you click on the markup, the element style will appear next to it, and the selected blocks will be highlighted on the page.

In the “Source” tab you can view the contents of some files: scripts, fonts, images.

In the “Security” tab, you can check the site’s certificate.

The “Audits” tab will help you check the resource posted on the hosting.

If the location of the panel on the right is inconvenient, you can click the three dots and change it by selecting the desired item.

How to view meta tags

Every HTML document includes structure tags. Here are some of them:

  1. Html – the entire document.
  2. Head – section of service headers.
  3. Title – page title (displayed on the tab).
  4. Body – the body of the document.
  5. H1-H6 – page text headings.
  6. Article – article.
  7. Section - section.
  8. Menu – menu.
  9. Div – block.
  10. Span – string.
  11. P – paragraph.
  12. Table – table.

Elements are designed to logically delimit sections on a page; if necessary, they are designed using styles. They contain text that is somehow visible on the page. But in the Head tag there is service information. Meta tags are used to indicate it. Everything that is written in them is intended for the server and search engines.

Their contents cannot be found out in any other way.

Let's pay attention to Link tag. With its help, links to external included files are specified. If desired, you can see the contents and save to disk. To do this, move the pointer to the address and press RMB. Select "Open in new Tab".

Will open in a new tab specified file, which you can view or save.

How to view the source code of a page to debug a script

In this case, it is most convenient to open the page on the local machine. If you only need to correct markup, styles and scripts, then this can be done directly from the folder. The HTML code is viewed in the same way. Here are the mistakes JavaScript code can be seen in the “Console” tab. This shows the description of the error and the line number where it occurred.

The syntax can be seen directly in the code. This is what the “Source” tab is for.

How to view the code of a specific element

For large pages with big amount elements are difficult to find required code throughout the markup. In this case, you should use special team context menu. Move the mouse over the fragment and press RMB. Select the “View Code” command.

The same window will open, but with the focus on the selected object.

Summary

We told you what the page source code is. It is enough to master basic knowledge of HTML and CSS, and using convenient tools developer, you can debug your own HTML documents.

Viewing resource code on the Internet will allow you to learn not only from own experience, but also use real working examples. And for SEO specialists, meta tags will be useful, the information in which can tell a lot about the site.

Ctrl+U

How can I view the source code of an element?

Right-click on the page element of interest.

Google Chrome: “View element code”

Opera: “Inspect element”

Firefox: “Analyze element”

In other browsers, look for a menu item with a similar meaning.

Hi all!

I especially laid out the whole point at the beginning of the article, for those who are looking for a quick answer.

The information may be known to many, but since I am writing for novice bloggers, web programmers and other prospectors, this reference article is a must-have.

In the future, you will definitely study the source code of pages and individual elements.

Let's take a look at specific example how you can use viewing the source code of a page.

For example, we want to see what keywords are used for specific page. We go to the web page we are interested in and press Ctrl+U. IN separate window or in separate tab The source code for this page will open. Press Ctrl+F to search for a code snippet. IN in this case type the word “in the search box” keywords". You will be automatically redirected to a piece of code with this meta tag and the searched word will be highlighted.

By analogy, you can search and study other code fragments.

Viewing the entire source code of a page is not very convenient in most cases, so it is possible to view the code in all browsers individual element or fragment.

Let's use a specific example of viewing an element's code. For example, let's see if the link has a nofollow attribute. Right-click on the link that interests us and in the drop-down context menu, left-click on the item “View element code” or similar (depending on your browser). Below, in a special window for code analysis, we get something similar.

We see that the link code contains rel=”nofollow” . This means that PR will not “leak” through this link. We will talk about this in more detail in the following articles. Now the important thing is that you now know how to view the source code of the page and the source code of an individual element.

For a long time, the “show page source” option was useless and uninteresting for me. Bye learning HTML on Codecademy and the layout of my own websites did not develop into my new hobby. Here the question arose: where to find real cases and borrow interesting solutions for your “piggy bank”? The answer was unexpectedly simple, like all ingenious things: look at the source code of the page in Google Chrome! I share with you my modest finds.

What is the page source code

If you, like me, are just taking your first steps in HTML programming, it would be a good idea to find out what the source code of a page is.

Source code, also known as HTML page code, is text in Hyper Text Markup Language (HTML). It includes the actual page content (text, tables) and tags. The latter act as instructions for the browser: how to display content, what type of formatting to use, where to insert a hyperlink or media file. Well, for us, novice programmers, the source code is the best training ground: we find an interesting site and spy on it, save it, and use successful fragments. How?

How to view the source code in the Google Chrome browser page

Find the page you like. For example, I was interested in the design of the site menu. Open source code at Google browser Chrome can be done in three ways:

  1. Click on the icon menu in the right top corner browser and select " Additional tools" Among others, there is an option “View source code”. Frankly, I rarely use it this method: a lot of unnecessary movements. It can be made even simpler.
  2. Press the key combination Ctrl+U– a new window with the source code opens;
  3. For fans of the context menu: right-click on the page and select the “View page code” option.

We coped with the task of viewing the HTML code of the page in the browser. Let's move on to the most interesting stage.

How to edit and save source code

To learn how to create websites, it is not enough to read someone else's HTML code. You need to play with it, experiment, make changes and check the result. You can even start by compiling a few successful samples. How to edit and save source code?

Option 1. “Manually”

After we have opened the source code of the page, we call context menu and select the “Save As” option and save the file to HDD. We edit the file in Notepad or Notepad, save the changes and open it through the browser. The results of our changes (successful and not so successful) will be reflected in the browser window.

Option 2. For the pros

When you "play" with source code every day, the process of "save - open - change - save - check" becomes tiring. For myself, I found a solution in the form of installing a plugin for Google Chrome - Firebug Lite. It allows you to edit and save source code without leaving the browser window.

Looking through countless sites on the Internet, you can come across ones that we really like. A number of questions immediately arise. Was the site made using homemade code or some kind of CMS? What are his CSS styles? What are its meta tags? And so on.

There are many tools that can be used to extract information about the code of a website page. But we always have the right mouse button at hand. This is what we will use, using my site as an example.

How to view the page code?

To view the source code of a site page, you need to hover your mouse over any area of ​​the web page (except for images and links). After this, click on the right mouse button. A window with several options will open in front of us (in different browsers they may differ slightly). In the Google Chrome browser, for example, these are the commands:

  • back;
  • forward;
  • reboot;
  • save as;
  • seal;
  • translate to Russian;
  • view page code;
  • view code.

We need to click on view page code, and the html code of the site page will open in front of us.

Viewing the page code: what to pay attention to?

So, the Html page code is a numbered list of lines, each of which carries information about how this site is made. To quickly learn to understand this a huge number signs and special characters, you need to distinguish between different sections of the code.

For example, lines of code inside the head tag contain information for search engines and webmasters. They are not displayed on the site. Here you can see how keywords This page is promoted based on how its title and description are written. You can also find a link here, by clicking on which we will learn about the family google fonts used on the site.

If the site is made on CMS WordPress or Joomla, then it will also be visible here. For example, this area displays information about WordPress theme or Joomla template site. You can see it by reading the contents of the links highlighted in blue. One link shows a website template.

For example:

//fonts.googleapis.com/css?family=Source+Sans+Pro%3A400%2C400italic%2C600&ver=4.5.3

We will see the CSS font styles of the page. In this case, the font is used. This can be seen here - font-family: 'Source Sans Pro'.

This site is optimized using an SEO plugin Yoast SEO. This can be seen from this commented section of code:

This site is optimized with the Yoast SEO plugin v3.4.2 - https://yoast.com/wordpress/plugins/seo/

All information contained inside the body tag is displayed by the browser on the monitor screen. Here we see the html code of the page, and at the very bottom there is the Yandex Metrics script code. It is surrounded by a commented tag with the text:

/Yandex.Metrika counter

Let's sum it up

Having carried out a rather superficial analysis of the code home page site, we can draw a conclusion about the tools with which this page was made. We saw on it:

  • CMS WordPress;
  • Google font Source Sans Pro;
  • WordPress theme – Sydney;
  • Yoast plugins;
  • Yandex metrics counter.

Now the principle of analysis html code The site page is quite clear. It is not at all necessary to keep the page you are researching open in the browser. You can save the page code to your computer using the key combinations ctrl+a, ctrl+c, ctrl+v. Paste it into any text editor(Notepad++ is better) and save with html extension. This way, you can study it deeper at any time and find more useful information for yourself.